Skip to content

Commit

Permalink
fixed the distortion, introduced random room selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Simarilius-uk committed Nov 16, 2023
1 parent 2af5849 commit 9861fc9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
27 changes: 19 additions & 8 deletions i_scene_cp77_gltf/material_types/interior_mapping_nodegroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,14 +1058,25 @@ def andrew_willmotts_plane_interior_mapping_node_group():
andrew_willmotts_interior_mapping.links.new(AR_div.outputs[0], math_006.inputs[1])
andrew_willmotts_interior_mapping.links.new(AR_div.outputs[0], math_007.inputs[1])

AddGI = create_node(andrew_willmotts_interior_mapping.nodes,"NodeGroupInput",(2379., 840.))
AddCXYZ = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeCombineXYZ",(2677., 774.))
AddCXYZ.inputs[0].default_value=1.0
Add_VM = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeVectorMath",(2967., 803.), operation='DIVIDE')
Add_VM.inputs[0].default_value=(0.5,0,0.5)
andrew_willmotts_interior_mapping.links.new(AddGI.outputs[4], AddCXYZ.inputs[2])
andrew_willmotts_interior_mapping.links.new(AddCXYZ.outputs[0], Add_VM.inputs[1])
#andrew_willmotts_interior_mapping.links.new(Add_VM.outputs[0], vector_math_011.inputs[1])
AddGI = create_node(andrew_willmotts_interior_mapping.nodes,"NodeGroupInput",(10., 10.))
AR_div2 = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeMath",(10, 10.), operation='DIVIDE')
AR_div2.inputs[0].default_value = -1
AddCXYZ = create_node(andrew_willmotts_interior_mapping.nodes,"ShaderNodeCombineXYZ",(10., 10.))
AddCXYZ.inputs[0].default_value=-1.0
AddCXYZ.inputs[1].default_value=-1.0
AddCXYZ.inputs[2].default_value=-1.0
AddGI.parent = frame_001
AR_div2.parent = frame_001
AddCXYZ.parent = frame_001
AddGI.location=(7080., 1490.)
AR_div2.location=(7245, 1490.)
AddCXYZ.location= (7429., 1490.)

andrew_willmotts_interior_mapping.links.new(AddGI.outputs[4], AR_div2.inputs[1])
andrew_willmotts_interior_mapping.links.new(AR_div2.outputs[0], AddCXYZ.inputs[0])
andrew_willmotts_interior_mapping.links.new(AR_div2.outputs[0], AddCXYZ.inputs[1])
andrew_willmotts_interior_mapping.links.new(AR_div2.outputs[0], AddCXYZ.inputs[2])
andrew_willmotts_interior_mapping.links.new(AddCXYZ.outputs[0], vector_math_001.inputs[1])


return andrew_willmotts_interior_mapping
Expand Down
25 changes: 23 additions & 2 deletions i_scene_cp77_gltf/material_types/window_parallax_interior_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create(self,Data,Mat):
roomWidth = CreateShaderNodeValue(CurMat,Data["roomWidth"],-800, -100,"roomWidth")
# roomHeight
if 'roomHeight' in Data:
roomHeight = CreateShaderNodeValue(CurMat,Data["roomHeight"],-8000, -200,"roomHeight")
roomHeight = CreateShaderNodeValue(CurMat,Data["roomHeight"],-800, -200,"roomHeight")
# roomDepth
if 'roomDepth' in Data:
roomDepth = CreateShaderNodeValue(CurMat,Data["roomDepth"],-800, -300,"roomDepth")
Expand Down Expand Up @@ -70,6 +70,27 @@ def create(self,Data,Mat):
CurMat.links.new(InteriorMapping.outputs[0],flipbook.inputs[0])
CurMat.links.new(flipbook.outputs[0],bColNode.inputs[0])
CurMat.links.new(bColNode.outputs[0],CurMat.nodes['Material Output'].inputs[0])

#Randomise Rooms
WhiteNoiseTexture = create_node(CurMat.nodes,"ShaderNodeTexWhiteNoise",(-1077.558349609375, 946.2904052734375), label="White Noise Texture")
WhiteNoiseTexture.noise_dimensions='1D'
SeparateXYZ = create_node(CurMat.nodes,"ShaderNodeSeparateXYZ",(-1434.1156005859375, 899.5537719726562), label="Separate XYZ")
Math = create_node(CurMat.nodes,"ShaderNodeMath",(-1245.8779296875, 950.3339233398438), operation='FLOOR', label="Math")
Mathb = create_node(CurMat.nodes,"ShaderNodeMath",(-1245.8779296875, 930.3339233398438), operation='FLOOR', label="Mathb")
Mathc = create_node(CurMat.nodes,"ShaderNodeMath",(-1205.8779296875, 930.3339233398438), operation='MULTIPLY', label="Mathc")
Math002 = create_node(CurMat.nodes,"ShaderNodeMath",(-891.7330322265625, 936.3861694335938), operation='MULTIPLY', label="Math.002")
Math002.inputs[1].default_value=5
Math001 = create_node(CurMat.nodes,"ShaderNodeMath",(-715.7330322265625, 918.6345825195312), operation='FLOOR', label="Math.001")

CurMat.links.new(UV.outputs['UV'], SeparateXYZ.inputs[0])
CurMat.links.new(SeparateXYZ.outputs['X'], Math.inputs[0])
CurMat.links.new(SeparateXYZ.outputs['Y'], Mathb.inputs[0])
CurMat.links.new(Math.outputs['Value'], Mathc.inputs[0])
CurMat.links.new(Mathb.outputs['Value'], Mathc.inputs[1])
CurMat.links.new(Mathc.outputs['Value'], WhiteNoiseTexture.inputs[1])
CurMat.links.new(WhiteNoiseTexture.outputs['Value'], Math002.inputs[0])
CurMat.links.new(Math002.outputs['Value'], Math001.inputs[0])
CurMat.links.new(Math001.outputs['Value'], flipbook.inputs[1])
# LightsTempVariationAtNight
# AmountTurnOffAtNight
# TintColorAtNight
Expand All @@ -88,4 +109,4 @@ def create(self,Data,Mat):
# CurtainMaxCover
# CurtainCoverRandomize
# CurtainAlpha

0 comments on commit 9861fc9

Please sign in to comment.