├── .build
└── projects
│ └── xcode9-osx
│ ├── bgfx-shared-lib.xcodeproj
│ └── project.pbxproj
│ ├── bgfx.xcodeproj
│ └── project.pbxproj
│ ├── bimg.xcodeproj
│ └── project.pbxproj
│ ├── bimg_decode.xcodeproj
│ └── project.pbxproj
│ ├── bimg_encode.xcodeproj
│ └── project.pbxproj
│ ├── bx.xcodeproj
│ └── project.pbxproj
│ ├── example-common.xcodeproj
│ └── project.pbxproj
│ ├── fcpp.xcodeproj
│ └── project.pbxproj
│ ├── geometryc.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── geometryc Debug.xcscheme
│ │ └── geometryc Release.xcscheme
│ ├── geometryv.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── geometryv Debug.xcscheme
│ │ └── geometryv Release.xcscheme
│ ├── glsl-optimizer.xcodeproj
│ └── project.pbxproj
│ ├── glslang.xcodeproj
│ └── project.pbxproj
│ ├── shaderc.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── shaderc Debug.xcscheme
│ │ └── shaderc Release.xcscheme
│ ├── spirv-cross.xcodeproj
│ └── project.pbxproj
│ ├── spirv-opt.xcodeproj
│ └── project.pbxproj
│ ├── texturec.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── texturec Debug.xcscheme
│ │ └── texturec Release.xcscheme
│ ├── texturev.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── texturev Debug.xcscheme
│ │ └── texturev Release.xcscheme
│ ├── vistual-shader-graph.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── vistual-shader-graph Debug.xcscheme
│ │ └── vistual-shader-graph Release.xcscheme
│ └── vsg.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ ├── IDEWorkspaceChecks.plist
│ └── WorkspaceSettings.xcsettings
│ └── xcuserdata
│ └── zhouwei.xcuserdatad
│ ├── IDEFindNavigatorScopes.plist
│ ├── UserInterfaceState.xcuserstate
│ └── xcdebugger
│ ├── Breakpoints_v2.xcbkptlist
│ └── Expressions.xcexplist
├── .gitignore
├── LICENSE
├── README.md
├── _config.yml
├── images
├── shade-on-iOS.png
├── ue-shader-graph.png
├── unity-shader-graph.png
├── visual-shader-graph.png
├── vsg-example.png
└── vsg-game.png
├── node_examples
├── add_shader.nodedata
├── add_shader
│ ├── add_shader_frag.sc
│ ├── add_shader_vertex.sc
│ └── varying.def.sc
├── blackbody.nodedata
├── blackbody
│ ├── blackbody_frag.sc
│ ├── blackbody_vertex.sc
│ └── varying.def.sc
├── brick_tex.nodedata
├── brick_tex
│ ├── brick_tex_frag.sc
│ ├── brick_tex_vertex.sc
│ └── varying.def.sc
├── bump.nodedata
├── bump
│ ├── bump_frag.sc
│ ├── bump_vertex.sc
│ └── varying.def.sc
├── checker_tex.nodedata
├── checker_tex
│ ├── checker_tex_frag.sc
│ ├── checker_tex_vertex.sc
│ └── varying.def.sc
├── clamp.nodedata
├── clamp
│ ├── clamp_frag.sc
│ ├── clamp_vertex.sc
│ └── varying.def.sc
├── game.nodedata
├── game
│ ├── game_frag.sc
│ ├── game_vertex.sc
│ └── varying.def.sc
├── gradient_tex.nodedata
├── gradient_tex
│ ├── gradient_tex_frag.sc
│ ├── gradient_tex_vertex.sc
│ └── varying.def.sc
├── image_tex.nodedata
├── image_tex
│ ├── image_tex_frag.sc
│ ├── image_tex_vertex.sc
│ └── varying.def.sc
├── map_range.nodedata
├── map_range
│ ├── map_range_frag.sc
│ ├── map_range_vertex.sc
│ └── varying.def.sc
├── math.nodedata
├── math
│ ├── math_frag.sc
│ ├── math_vertex.sc
│ └── varying.def.sc
├── migic_tex.nodedata
├── migic_tex
│ ├── migic_tex_frag.sc
│ ├── migic_tex_vertex.sc
│ └── varying.def.sc
├── musgrave_tex.nodedata
├── musgrave_tex
│ ├── musgrave_tex_frag.sc
│ ├── musgrave_tex_vertex.sc
│ └── varying.def.sc
├── noise_tex.nodedata
├── noise_tex
│ ├── noise_tex_frag.sc
│ ├── noise_tex_vertex.sc
│ └── varying.def.sc
├── ramp_color.nodedata
├── ramp_color
│ ├── ramp_color_frag.sc
│ ├── ramp_color_vertex.sc
│ └── varying.def.sc
├── rgb2bw.nodedata
├── rgb2bw
│ ├── rgb2bw_frag.sc
│ ├── rgb2bw_vertex.sc
│ └── varying.def.sc
├── rgb_curve.nodedata
├── rgb_curve
│ ├── rgb_curve_frag.sc
│ ├── rgb_curve_vertex.sc
│ └── varying.def.sc
├── vec_trans.nodedata
├── vec_trans
│ ├── varying.def.sc
│ ├── vec_trans_frag.sc
│ └── vec_trans_vertex.sc
├── vector_math.nodedata
├── vector_math
│ ├── varying.def.sc
│ ├── vector_math_frag.sc
│ └── vector_math_vertex.sc
├── voronoi_tex.nodedata
├── voronoi_tex
│ ├── varying.def.sc
│ ├── voronoi_tex_frag.sc
│ └── voronoi_tex_vertex.sc
├── wave_length.nodedata
├── wave_length
│ ├── varying.def.sc
│ ├── wave_length_frag.sc
│ └── wave_length_vertex.sc
├── wave_tex.nodedata
├── wave_tex
│ ├── varying.def.sc
│ ├── wave_tex_frag.sc
│ └── wave_tex_vertex.sc
├── white_noise.nodedata
└── white_noise
│ ├── varying.def.sc
│ ├── white_noise_frag.sc
│ └── white_noise_vertex.sc
├── runtime_visual_shader
├── .gitignore
├── common
│ ├── common.sh
│ ├── font
│ │ ├── fs_font_basic.sc
│ │ ├── fs_font_distance_field.sc
│ │ ├── fs_font_distance_field_drop_shadow.sc
│ │ ├── fs_font_distance_field_drop_shadow_image.sc
│ │ ├── fs_font_distance_field_outline.sc
│ │ ├── fs_font_distance_field_outline_drop_shadow_image.sc
│ │ ├── fs_font_distance_field_outline_image.sc
│ │ ├── fs_font_distance_field_subpixel.sc
│ │ ├── varying.def.sc
│ │ ├── vs_font_basic.sc
│ │ ├── vs_font_distance_field.sc
│ │ ├── vs_font_distance_field_drop_shadow.sc
│ │ ├── vs_font_distance_field_drop_shadow_image.sc
│ │ ├── vs_font_distance_field_outline.sc
│ │ ├── vs_font_distance_field_outline_drop_shadow_image.sc
│ │ ├── vs_font_distance_field_outline_image.sc
│ │ └── vs_font_distance_field_subpixel.sc
│ ├── ps
│ │ ├── fs_particle.sc
│ │ ├── varying.def.sc
│ │ └── vs_particle.sc
│ └── shaderlib.sh
├── font
│ ├── NotoEmoji-Regular.ttf
│ ├── bleeding_cowboys.ttf
│ ├── chp-fire.ttf
│ ├── droidsans.ttf
│ ├── droidsansmono.ttf
│ ├── entypo.ttf
│ ├── five_minutes.otf
│ ├── fontawesome-webfont.ttf
│ ├── glyph_long.png
│ ├── glyph_space.png
│ ├── kenney-icon-font.ttf
│ ├── mias_scribblings.ttf
│ ├── roboto-bold.ttf
│ ├── roboto-regular.ttf
│ ├── robotomono-regular.ttf
│ ├── ruritania.ttf
│ ├── signika-regular.ttf
│ ├── special_elite.ttf
│ └── visitor1.ttf
├── ios-info.plist
├── meshes
│ ├── Marry
│ │ ├── MC003_Kozakura_Mari.png
│ │ ├── Marry.mtl
│ │ └── hmap.jpg
│ └── spot
│ │ ├── hmap.jpg
│ │ └── spot_texture.png
├── node
│ ├── color.meta
│ ├── color
│ │ ├── node_brightness_contrast.cginc
│ │ ├── node_brightness_contrast.cginc.meta
│ │ ├── node_curves_rgb.cginc
│ │ ├── node_curves_rgb.cginc.meta
│ │ ├── node_gamma.cginc
│ │ ├── node_gamma.cginc.meta
│ │ ├── node_hsv.cginc
│ │ ├── node_hsv.cginc.meta
│ │ ├── node_invert.cginc
│ │ ├── node_invert.cginc.meta
│ │ ├── node_light_falloff.cginc
│ │ ├── node_light_falloff.cginc.meta
│ │ ├── node_mix.cginc
│ │ └── node_mix.cginc.meta
│ ├── converter.meta
│ ├── converter
│ │ ├── node_blackbody.cginc
│ │ ├── node_blackbody.cginc.meta
│ │ ├── node_clamp.cginc
│ │ ├── node_clamp.cginc.meta
│ │ ├── node_color_ramp.cginc
│ │ ├── node_color_ramp.cginc.meta
│ │ ├── node_combine_hsv.cginc
│ │ ├── node_combine_hsv.cginc.meta
│ │ ├── node_combine_rgb.cginc
│ │ ├── node_combine_rgb.cginc.meta
│ │ ├── node_combine_xyz.cginc
│ │ ├── node_combine_xyz.cginc.meta
│ │ ├── node_map_range.cginc
│ │ ├── node_map_range.cginc.meta
│ │ ├── node_math.cginc
│ │ ├── node_math.cginc.meta
│ │ ├── node_rgbtobw.cginc
│ │ ├── node_rgbtobw.cginc.meta
│ │ ├── node_separate_hsv.cginc
│ │ ├── node_separate_hsv.cginc.meta
│ │ ├── node_separate_rgb.cginc
│ │ ├── node_separate_rgb.cginc.meta
│ │ ├── node_separate_xyz.cginc
│ │ ├── node_separate_xyz.cginc.meta
│ │ ├── node_vector_math.cginc
│ │ ├── node_vector_math.cginc.meta
│ │ ├── node_wavelength.cginc
│ │ └── node_wavelength.cginc.meta
│ ├── include.meta
│ ├── include
│ │ ├── base_h.cginc
│ │ ├── base_h.cginc.meta
│ │ ├── color_h.cginc
│ │ ├── color_h.cginc.meta
│ │ ├── define_h.cginc
│ │ ├── define_h.cginc.meta
│ │ ├── exe_h.cginc.meta
│ │ ├── fractal_noise_util_h.cginc
│ │ ├── fractal_noise_util_h.cginc.meta
│ │ ├── hash_util_h.cginc
│ │ ├── hash_util_h.cginc.meta
│ │ ├── light_h.cginc
│ │ ├── light_h.cginc.meta
│ │ ├── math_util_h.cginc
│ │ ├── math_util_h.cginc.meta
│ │ ├── noise_util_h.cginc
│ │ ├── noise_util_h.cginc.meta
│ │ ├── share_uniform.cginc
│ │ ├── share_uniform.cginc.meta
│ │ ├── texture_def_h.cginc
│ │ └── texture_def_h.cginc.meta
│ ├── input.meta
│ ├── input
│ │ ├── node_ambient_occlusion.cginc
│ │ ├── node_ambient_occlusion.cginc.meta
│ │ ├── node_bevel.cginc
│ │ ├── node_bevel.cginc.meta
│ │ ├── node_camera.cginc
│ │ ├── node_camera.cginc.meta
│ │ ├── node_fresnel.cginc
│ │ ├── node_fresnel.cginc.meta
│ │ ├── node_geometry.cginc
│ │ ├── node_geometry.cginc.meta
│ │ ├── node_layer_weight.cginc
│ │ ├── node_layer_weight.cginc.meta
│ │ ├── node_light_path.cginc
│ │ ├── node_light_path.cginc.meta
│ │ ├── node_object_info.cginc
│ │ ├── node_object_info.cginc.meta
│ │ ├── node_rgb.cginc
│ │ ├── node_rgb.cginc.meta
│ │ ├── node_tangent.cginc
│ │ ├── node_tangent.cginc.meta
│ │ ├── node_tex_coord.cginc
│ │ ├── node_tex_coord.cginc.meta
│ │ ├── node_value.cginc
│ │ ├── node_value.cginc.meta
│ │ ├── node_vertex_color.cginc
│ │ ├── node_vertex_color.cginc.meta
│ │ ├── node_wireframe.cginc
│ │ └── node_wireframe.cginc.meta
│ ├── light.meta
│ ├── light
│ │ ├── closure_eval_lib.cginc
│ │ ├── closure_eval_lib.cginc.meta
│ │ ├── closure_type_lib.cginc
│ │ ├── clusure_data_lib.sh
│ │ ├── clusure_data_lib.sh.meta
│ │ ├── eval_diffuse_lib.cginc
│ │ ├── eval_diffuse_lib.cginc.meta
│ │ ├── eval_surface_lib.cginc
│ │ └── eval_surface_lib.cginc.meta
│ ├── node.cginc
│ ├── node.cginc.meta
│ ├── shader.meta
│ ├── shader
│ │ ├── node_add_shader.cginc
│ │ ├── node_bsdf_anisotropic.cginc
│ │ ├── node_bsdf_diffuse.cginc
│ │ ├── node_bsdf_diffuse.cginc.meta
│ │ ├── node_bsdf_emission.cginc
│ │ ├── node_bsdf_oren_nayar.cginc
│ │ ├── node_bsdf_surface.cginc
│ │ ├── node_bsdf_surface.cginc.meta
│ │ └── node_mix_shader.cginc
│ ├── texture.meta
│ ├── texture
│ │ ├── node_tex_brick.cginc
│ │ ├── node_tex_brick.cginc.meta
│ │ ├── node_tex_checker.cginc
│ │ ├── node_tex_checker.cginc.meta
│ │ ├── node_tex_gradient.cginc
│ │ ├── node_tex_gradient.cginc.meta
│ │ ├── node_tex_image.cginc
│ │ ├── node_tex_image.cginc.meta
│ │ ├── node_tex_magic.cginc
│ │ ├── node_tex_magic.cginc.meta
│ │ ├── node_tex_musgrave.cginc
│ │ ├── node_tex_musgrave.cginc.meta
│ │ ├── node_tex_noise.cginc
│ │ ├── node_tex_noise.cginc.meta
│ │ ├── node_tex_voronoi.cginc
│ │ ├── node_tex_voronoi.cginc.meta
│ │ ├── node_tex_wave.cginc
│ │ ├── node_tex_wave.cginc.meta
│ │ ├── node_tex_white_noise.cginc
│ │ └── node_tex_white_noise.cginc.meta
│ ├── vector.meta
│ └── vector
│ │ ├── node_bump.cginc
│ │ ├── node_bump.cginc.meta
│ │ ├── node_displacement.cginc
│ │ ├── node_displacement.cginc.meta
│ │ ├── node_mapping.cginc
│ │ ├── node_mapping.cginc.meta
│ │ ├── node_normal.cginc
│ │ ├── node_normal.cginc.meta
│ │ ├── node_normal_map.cginc
│ │ ├── node_normal_map.cginc.meta
│ │ ├── node_vector_curves.cginc
│ │ ├── node_vector_curves.cginc.meta
│ │ ├── node_vector_displacement.cginc
│ │ ├── node_vector_displacement.cginc.meta
│ │ ├── node_vector_rotate.cginc
│ │ ├── node_vector_rotate.cginc.meta
│ │ ├── node_vector_transform.cginc
│ │ └── node_vector_transform.cginc.meta
├── osx-info.plist
├── shader_graph
│ ├── pbr.nodedata
│ └── pbr
│ │ ├── pbr_frag.sc
│ │ ├── pbr_vertex.sc
│ │ └── varying.def.sc
├── shaders
│ ├── essl
│ │ ├── fs_cubes.bin
│ │ ├── fs_hdr_skybox.bin
│ │ ├── vs_cubes.bin
│ │ └── vs_hdr_skybox.bin
│ └── metal
│ │ ├── fs_cubes.bin
│ │ ├── fs_hdr_skybox.bin
│ │ ├── vs_cubes.bin
│ │ └── vs_hdr_skybox.bin
├── source_shader
│ ├── cubes
│ │ ├── fs_cubes.sc
│ │ ├── varying.def.sc
│ │ └── vs_cubes.sc
│ ├── mesh
│ │ ├── fs_mesh.sc
│ │ ├── varying.def.sc
│ │ └── vs_mesh.sc
│ ├── role
│ │ ├── fs_role.sc
│ │ ├── varying.def.sc
│ │ └── vs_role.sc
│ └── sky
│ │ ├── fs_hdr_skybox.sc
│ │ ├── varying.def.sc
│ │ └── vs_hdr_skybox.sc
├── src_shader
│ ├── bgfx_compute.sh
│ ├── bgfx_shader.sh
│ ├── fs_clear0.bin.h
│ ├── fs_clear0.sc
│ ├── fs_clear1.bin.h
│ ├── fs_clear1.sc
│ ├── fs_clear2.bin.h
│ ├── fs_clear2.sc
│ ├── fs_clear3.bin.h
│ ├── fs_clear3.sc
│ ├── fs_clear4.bin.h
│ ├── fs_clear4.sc
│ ├── fs_clear5.bin.h
│ ├── fs_clear5.sc
│ ├── fs_clear6.bin.h
│ ├── fs_clear6.sc
│ ├── fs_clear7.bin.h
│ ├── fs_clear7.sc
│ ├── fs_debugfont.bin.h
│ ├── fs_debugfont.sc
│ ├── varying.def.sc
│ ├── vs_clear.bin.h
│ ├── vs_clear.sc
│ ├── vs_debugfont.bin.h
│ └── vs_debugfont.sc
├── text
│ └── sherlock_holmes_a_scandal_in_bohemia_arthur_conan_doyle.txt
├── textures
│ ├── TexturesCom_AeratedConcrete_Worn_1K_albedo.png
│ ├── TexturesCom_AeratedConcrete_Worn_1K_ao.png
│ ├── TexturesCom_AeratedConcrete_Worn_1K_height.png
│ ├── TexturesCom_AeratedConcrete_Worn_1K_normal.png
│ ├── TexturesCom_AeratedConcrete_Worn_1K_roughness.png
│ ├── parallax-d.ktx
│ └── uffizi.ktx
└── tvos-info.plist
└── src
├── common
├── aviwriter.h
├── bgfx_utils.cpp
├── bgfx_utils.h
├── bounds.cpp
├── bounds.h
├── bounds.inl
├── camera.cpp
├── camera.h
├── common.h
├── common.sh
├── cube_atlas.cpp
├── cube_atlas.h
├── debugdraw
│ ├── debugdraw.cpp
│ ├── debugdraw.h
│ ├── fs_debugdraw_fill.bin.h
│ ├── fs_debugdraw_fill.sc
│ ├── fs_debugdraw_fill_lit.bin.h
│ ├── fs_debugdraw_fill_lit.sc
│ ├── fs_debugdraw_fill_texture.bin.h
│ ├── fs_debugdraw_fill_texture.sc
│ ├── fs_debugdraw_lines.bin.h
│ ├── fs_debugdraw_lines.sc
│ ├── fs_debugdraw_lines_stipple.bin.h
│ ├── fs_debugdraw_lines_stipple.sc
│ ├── makefile
│ ├── varying.def.sc
│ ├── vs_debugdraw_fill.bin.h
│ ├── vs_debugdraw_fill.sc
│ ├── vs_debugdraw_fill_lit.bin.h
│ ├── vs_debugdraw_fill_lit.sc
│ ├── vs_debugdraw_fill_lit_mesh.bin.h
│ ├── vs_debugdraw_fill_lit_mesh.sc
│ ├── vs_debugdraw_fill_mesh.bin.h
│ ├── vs_debugdraw_fill_mesh.sc
│ ├── vs_debugdraw_fill_texture.bin.h
│ ├── vs_debugdraw_fill_texture.sc
│ ├── vs_debugdraw_lines.bin.h
│ ├── vs_debugdraw_lines.sc
│ ├── vs_debugdraw_lines_stipple.bin.h
│ └── vs_debugdraw_lines_stipple.sc
├── entry
│ ├── cmd.cpp
│ ├── cmd.h
│ ├── dbg.h
│ ├── dialog.cpp
│ ├── dialog.h
│ ├── dialog_darwin.mm
│ ├── entry.cpp
│ ├── entry.h
│ ├── entry_android.cpp
│ ├── entry_glfw.cpp
│ ├── entry_html5.cpp
│ ├── entry_ios.mm
│ ├── entry_noop.cpp
│ ├── entry_osx.mm
│ ├── entry_p.h
│ ├── entry_sdl.cpp
│ ├── entry_windows.cpp
│ ├── entry_winrt.cx
│ ├── entry_x11.cpp
│ ├── input.cpp
│ └── input.h
├── example-glue.cpp
├── font
│ ├── font_manager.cpp
│ ├── font_manager.h
│ ├── fs_font_basic.bin.h
│ ├── fs_font_basic.sc
│ ├── fs_font_distance_field.bin.h
│ ├── fs_font_distance_field.sc
│ ├── fs_font_distance_field_drop_shadow.bin.h
│ ├── fs_font_distance_field_drop_shadow.sc
│ ├── fs_font_distance_field_drop_shadow_image.bin.h
│ ├── fs_font_distance_field_drop_shadow_image.sc
│ ├── fs_font_distance_field_outline.bin.h
│ ├── fs_font_distance_field_outline.sc
│ ├── fs_font_distance_field_outline_drop_shadow_image.bin.h
│ ├── fs_font_distance_field_outline_drop_shadow_image.sc
│ ├── fs_font_distance_field_outline_image.bin.h
│ ├── fs_font_distance_field_outline_image.sc
│ ├── fs_font_distance_field_subpixel.bin.h
│ ├── fs_font_distance_field_subpixel.sc
│ ├── makefile
│ ├── text_buffer_manager.cpp
│ ├── text_buffer_manager.h
│ ├── text_metrics.cpp
│ ├── text_metrics.h
│ ├── utf8.cpp
│ ├── utf8.h
│ ├── varying.def.sc
│ ├── vs_font_basic.bin.h
│ ├── vs_font_basic.sc
│ ├── vs_font_distance_field.bin.h
│ ├── vs_font_distance_field.sc
│ ├── vs_font_distance_field_drop_shadow.bin.h
│ ├── vs_font_distance_field_drop_shadow.sc
│ ├── vs_font_distance_field_drop_shadow_image.bin.h
│ ├── vs_font_distance_field_drop_shadow_image.sc
│ ├── vs_font_distance_field_outline.bin.h
│ ├── vs_font_distance_field_outline.sc
│ ├── vs_font_distance_field_outline_drop_shadow_image.bin.h
│ ├── vs_font_distance_field_outline_drop_shadow_image.sc
│ ├── vs_font_distance_field_outline_image.bin.h
│ ├── vs_font_distance_field_outline_image.sc
│ ├── vs_font_distance_field_subpixel.bin.h
│ └── vs_font_distance_field_subpixel.sc
├── imgui
│ ├── droidsans.ttf.h
│ ├── fs_imgui_image.bin.h
│ ├── fs_imgui_image.sc
│ ├── fs_ocornut_imgui.bin.h
│ ├── fs_ocornut_imgui.sc
│ ├── icons_font_awesome.ttf.h
│ ├── icons_kenney.ttf.h
│ ├── imgui.cpp
│ ├── imgui.h
│ ├── makefile
│ ├── roboto_regular.ttf.h
│ ├── robotomono_regular.ttf.h
│ ├── varying.def.sc
│ ├── vs_imgui_image.bin.h
│ ├── vs_imgui_image.sc
│ ├── vs_ocornut_imgui.bin.h
│ └── vs_ocornut_imgui.sc
├── nanovg
│ ├── fontstash.h
│ ├── fs_nanovg_fill.bin.h
│ ├── fs_nanovg_fill.sc
│ ├── makefile
│ ├── nanovg.cpp
│ ├── nanovg.h
│ ├── nanovg_bgfx.cpp
│ ├── nanovg_bgfx.h
│ ├── varying.def.sc
│ ├── vs_nanovg_fill.bin.h
│ └── vs_nanovg_fill.sc
├── nativefiledialog
│ ├── nfd.cpp
│ ├── nfd.h
│ ├── nfd_cocoa.mm
│ ├── nfd_gtk.cpp
│ ├── nfd_ios.mm
│ └── nfd_win.cpp
├── packrect.h
├── ps
│ ├── fs_particle.bin.h
│ ├── fs_particle.sc
│ ├── makefile
│ ├── particle_system.cpp
│ ├── particle_system.h
│ ├── varying.def.sc
│ ├── vs_particle.bin.h
│ └── vs_particle.sc
└── shaderlib.sh
├── runtime
├── ios-info.plist
├── osx-info.plist
└── tvos-info.plist
└── vistual-shader-graph
├── include
└── shader.h
├── shader_online
├── shader_complie
│ ├── code_generate.cpp
│ ├── code_generate.h
│ ├── code_rampcolor_byte.cpp
│ ├── code_rampcolor_byte.h
│ └── slot_type.cpp
├── shader_core
│ ├── config.h
│ ├── lerp.h
│ ├── rect.cpp
│ ├── rect.h
│ ├── shader_def.h
│ ├── stack_vector.h
│ ├── util_enum.h
│ ├── vector.cpp
│ └── vector.h
├── shader_editor
│ ├── alt_slot_names.cpp
│ ├── alt_slot_names.h
│ ├── enum.h
│ ├── event.cpp
│ ├── event.h
│ ├── glfw_callbacks.cpp
│ ├── glfw_callbacks.h
│ ├── graph_display.h
│ ├── main_window.cpp
│ ├── main_window.h
│ ├── modal_curve_editor.cpp
│ ├── modal_curve_editor.h
│ ├── modal_ramp_color_pick.cpp
│ ├── modal_ramp_color_pick.h
│ ├── node_geometry.cpp
│ ├── node_geometry.h
│ ├── platform.cpp
│ ├── platform.h
│ ├── selection.cpp
│ ├── selection.h
│ ├── shared_state.cpp
│ ├── shared_state.h
│ ├── subwindow_alert.cpp
│ ├── subwindow_alert.h
│ ├── subwindow_debug.cpp
│ ├── subwindow_debug.h
│ ├── subwindow_debug_shader_text.cpp
│ ├── subwindow_graph.cpp
│ ├── subwindow_graph.h
│ ├── subwindow_node_list.cpp
│ ├── subwindow_node_list.h
│ ├── subwindow_param_editor.cpp
│ ├── subwindow_param_editor.h
│ ├── subwindow_shader_text.h
│ ├── undo.cpp
│ ├── undo.h
│ ├── wrapper_glfw_func.cpp
│ ├── wrapper_glfw_func.h
│ ├── wrapper_glfw_window.cpp
│ ├── wrapper_glfw_window.h
│ └── wrapper_imgui_func.h
└── shader_graph
│ ├── curves.cpp
│ ├── curves.h
│ ├── ext_base64.h
│ ├── graph.cpp
│ ├── graph.h
│ ├── node.cpp
│ ├── node.h
│ ├── node_enums.cpp
│ ├── node_enums.h
│ ├── node_id.h
│ ├── node_type.cpp
│ ├── node_type.h
│ ├── ramp.cpp
│ ├── ramp.h
│ ├── serialize.cpp
│ ├── serialize.h
│ ├── slot.cpp
│ ├── slot.h
│ ├── slot_id.cpp
│ └── slot_id.h
├── shaderc
├── shaderc.cpp
├── shaderc.h
├── shaderc_glsl.cpp
├── shaderc_hlsl.cpp
├── shaderc_metal.cpp
├── shaderc_pssl.cpp
└── shaderc_spirv.cpp
├── user_engine.cpp
├── user_engine.h
├── user_engine
├── BaseDefine.h
├── Light.h
├── Mesh.h
├── MeshFilter.cpp
├── MeshFilter.h
├── MeshUtil.cpp
├── MeshUtil.h
├── Object.h
├── Scene.cpp
├── Scene.h
├── ShaderMaterialDef.h
├── Sky.cpp
├── Sky.h
└── Sphere.h
├── vsg_entry.cpp
├── vsg_global.cpp
└── vsg_global.h
/.build/projects/xcode9-osx/vsg.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.build/projects/xcode9-osx/vsg.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.build/projects/xcode9-osx/vsg.xcworkspace/xcuserdata/zhouwei.xcuserdatad/IDEFindNavigatorScopes.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.build/projects/xcode9-osx/vsg.xcworkspace/xcuserdata/zhouwei.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/.build/projects/xcode9-osx/vsg.xcworkspace/xcuserdata/zhouwei.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .svn
2 | .build/projects/xcode9-ios/
3 | test/
4 |
5 |
6 | # Prerequisites
7 | *.d
8 |
9 | # Compiled Object files
10 | *.slo
11 | *.lo
12 | *.o
13 | *.obj
14 |
15 | # Precompiled Headers
16 | *.gch
17 | *.pch
18 |
19 | # Compiled Dynamic libraries
20 | *.so
21 | *.dylib
22 | *.dll
23 |
24 | # Fortran module files
25 | *.mod
26 | *.smod
27 |
28 | # Compiled Static libraries
29 | *.lai
30 | *.la
31 | *.a
32 | *.lib
33 |
34 | # Executables
35 | *.exe
36 | *.out
37 | *.app
38 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/images/shade-on-iOS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/images/shade-on-iOS.png
--------------------------------------------------------------------------------
/images/ue-shader-graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/images/ue-shader-graph.png
--------------------------------------------------------------------------------
/images/unity-shader-graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/images/unity-shader-graph.png
--------------------------------------------------------------------------------
/images/visual-shader-graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/images/visual-shader-graph.png
--------------------------------------------------------------------------------
/images/vsg-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/images/vsg-example.png
--------------------------------------------------------------------------------
/images/vsg-game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/images/vsg-game.png
--------------------------------------------------------------------------------
/node_examples/add_shader.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|add_shader|_nodeid_Y2j4GCWmFow=|267|-36|node_end|image_tex|_nodeid_bS4a7yaUba4=|-275|-292|interpolation_type|node_tex_image_linear_simple|projection_type|SHD_PROJ_BOX|image|meshes/Marry/MC003_Kozakura_Mari.png|node_end|rgb_to_bw|_nodeid_TJ/ep7oMRcw=|-286|19|color|0.7220,0.5882,0.5882|node_end|out_material|_nodeid_aRnOyq3U4OA=|248|-159|node_end|emission|_nodeid_xYlg2UysQDY=|-82|-55|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|section_connections|_nodeid_Y2j4GCWmFow=|Closure|_nodeid_aRnOyq3U4OA=|Surface|_nodeid_bS4a7yaUba4=|Color|_nodeid_xYlg2UysQDY=|Color|_nodeid_TJ/ep7oMRcw=|Val|_nodeid_xYlg2UysQDY=|Strength|_nodeid_xYlg2UysQDY=|Emission|_nodeid_Y2j4GCWmFow=|Closure1|_nodeid_xYlg2UysQDY=|Emission|_nodeid_Y2j4GCWmFow=|Closure2|
--------------------------------------------------------------------------------
/node_examples/add_shader/add_shader_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal, a_tangent // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, VERTEX_CD_TANGENT, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | VERTEX_CD_TANGENT = a_tangent;
35 | vWorldToLight = uLightVP;
36 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/node_examples/add_shader/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | vec3 VERTEX_CD_TANGENT:TEXCOORD5;
6 | mat4 vWorldToLight:TEXCOORD6;
7 | vec4 vPositionFromLight:TEXCOORD7;
8 |
9 |
10 | vec3 a_position:POSITION;
11 | vec2 a_texcoord0:TEXCOORD0;
12 | vec3 a_normal:NORMAL;
13 | vec3 a_tangent:TANGENT;
14 |
--------------------------------------------------------------------------------
/node_examples/blackbody.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|blackbody|_nodeid_ukvioSsJ5E4=|-271|-18|temperature|6475.9131|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/blackbody/blackbody_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/blackbody/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/brick_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|brick_tex|_nodeid_ukvioSsJ5E4=|-272|-194|offset|0.0330|offset_frequency|2|squash|0.5620|squash_frequency|2|color1|1.0000,0.0000,0.0000|color2|0.0000,1.0000,0.2239|mortar|0.0000,0.0000,0.0000|scale|1.4960|mortar_size|0.0150|mortar_smooth|0.3140|bias|0.2520|brick_width|0.5180|row_height|0.2500|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/brick_tex/brick_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/brick_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/bump.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|diffuse_bsdf|_nodeid_Y2j4GCWmFow=|-105|-265|color|0.9000,0.9000,0.9000|roughness|0.0000|node_end|add_shader|_nodeid_oVRZKBGV0Lk=|85|-168|node_end|checker_tex|_nodeid_We8C9/rauvc=|-515|89|color1|0.9000,0.9000,0.9000|color2|0.4000,0.4000,0.4000|scale|5.0000|node_end|emission|_nodeid_s8R4+DcBKvs=|-125|-50|color|0.9000,0.9000,0.9000|strength|0.0000|node_end|image_tex|_nodeid_5yof9eQWGP8=|-394|-165|interpolation_type|node_tex_image_linear_simple|projection_type|SHD_PROJ_BOX|image|meshes/Marry/MC003_Kozakura_Mari.png|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|bump|_nodeid_xKhLRxrNOTA=|-267|78|invert|0|strength|0.5220|distance|1.0000|node_end|section_connections|_nodeid_Y2j4GCWmFow=|BSDF|_nodeid_oVRZKBGV0Lk=|Closure1|_nodeid_oVRZKBGV0Lk=|Closure|_nodeid_XLuR0PaeriI=|Surface|_nodeid_We8C9/rauvc=|Fac|_nodeid_xKhLRxrNOTA=|Height|_nodeid_s8R4+DcBKvs=|Emission|_nodeid_oVRZKBGV0Lk=|Closure2|_nodeid_5yof9eQWGP8=|Color|_nodeid_Y2j4GCWmFow=|Color|_nodeid_5yof9eQWGP8=|Color|_nodeid_s8R4+DcBKvs=|Color|_nodeid_xKhLRxrNOTA=|Normal|_nodeid_Y2j4GCWmFow=|Normal|
--------------------------------------------------------------------------------
/node_examples/bump/bump_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/bump/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/checker_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|checker_tex|_nodeid_ukvioSsJ5E4=|-296|-32|color1|0.9000,0.9000,0.9000|color2|0.4000,0.4000,0.4000|scale|5.0000|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/checker_tex/checker_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/checker_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/clamp.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|clamp|_nodeid_ukvioSsJ5E4=|-254|21|clamp_type|clamp_minmax|value|0.7430|min|-161.2320|max|99.5360|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Result|_nodeid_LDWCIN+3B/g=|Strength|
--------------------------------------------------------------------------------
/node_examples/clamp/clamp_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/clamp/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/game.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|color_ramp|_nodeid_7vrh53kfw9U=|-269|-60|ramp|ramp00,0.0000,0.0000,0.0000,0.0000,1.0000,0.3000,0.0000,0.4762,1.0000,1.0000,0.6500,0.0000,1.0000,0.1310,1.0000,1.0000,0.9614,0.0000,0.0000,1.0000|fac|0.3500|node_end|emission|_nodeid_LDWCIN+3B/g=|16|-154|color|0.9000,0.9000,0.9000|strength|0.9500|node_end|out_material|_nodeid_XLuR0PaeriI=|220|-35|node_end|gamma|_nodeid_ukvioSsJ5E4=|-57|34|color|1.0000,1.0000,1.0000|gamma|0.1190|node_end|section_connections|_nodeid_7vrh53kfw9U=|Color|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/game/game_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal, a_tangent // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, VERTEX_CD_TANGENT, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(transpose((u_model[1])) , vec4(a_normal, 0.0)).xyz;
34 | VERTEX_CD_TANGENT = a_tangent;
35 | vWorldToLight = uLightVP;
36 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/node_examples/game/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:POSITION=vec3(0.0,0.0,0.0);
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD0=vec3(0.0,0.0,0.0);
3 | vec3 VERTEX_CD_ORCO:TEXCOORD1=vec3(0.0,0.0,0.0);
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD2=vec3(0.0,0.0,0.0);
5 | vec4 VERTEX_CD_TANGENT:TEXCOORD3=vec4(0.0,0.0,0.0,0.0);
6 | mat4 vWorldToLight:TEXCOORD4=0.0;
7 | vec4 vPositionFromLight:TEXCOORD5=vec4(0.0,0.0,0.0,0.0);
8 |
9 |
10 | vec3 a_position:POSITION;
11 | vec2 a_texcoord0:TEXCOORD0;
12 | vec3 a_normal:NORMAL;
13 | vec4 a_tangent:TANGENT;
14 |
--------------------------------------------------------------------------------
/node_examples/gradient_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|gradient_tex|_nodeid_ukvioSsJ5E4=|-318|-9|gradient_type|node_tex_gradient_linear|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/gradient_tex/gradient_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/gradient_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/image_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|image_tex|_nodeid_5yof9eQWGP8=|-290|8|interpolation_type|node_tex_image_linear_simple|projection_type|SHD_PROJ_BOX|image|meshes/Marry/MC003_Kozakura_Mari.png|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_5yof9eQWGP8=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/image_tex/image_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/image_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/map_range.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|map_range|_nodeid_Y2j4GCWmFow=|-294|-40|range_type|map_range_linear|value|0.7430|from_min|0.0000|from_max|1.0000|to_min|0.0000|to_max|1.0000|steps|4.0000|node_end|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.0883,0.7568,0.0701|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|section_connections|_nodeid_Y2j4GCWmFow=|Result|_nodeid_LDWCIN+3B/g=|Strength|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|
--------------------------------------------------------------------------------
/node_examples/map_range/map_range_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/map_range/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/math.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|map_range|_nodeid_Y2j4GCWmFow=|-294|-146|range_type|map_range_linear|value|0.7430|from_min|0.0000|from_max|1.0000|to_min|0.0000|to_max|1.0000|steps|4.0000|node_end|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.7529,0.0610,0.0610|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|map_range|_nodeid_xKhLRxrNOTA=|-344|76|range_type|map_range_linear|value|0.7430|from_min|0.0000|from_max|1.0000|to_min|0.0000|to_max|1.0000|steps|4.0000|node_end|math|_nodeid_ukvioSsJ5E4=|-44|93|math_type|math_sign|value1|0.0000|value2|0.0000|value3|0.0000|node_end|section_connections|_nodeid_Y2j4GCWmFow=|Result|_nodeid_ukvioSsJ5E4=|Value1|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_xKhLRxrNOTA=|Result|_nodeid_ukvioSsJ5E4=|Value2|_nodeid_ukvioSsJ5E4=|Value|_nodeid_LDWCIN+3B/g=|Strength|
--------------------------------------------------------------------------------
/node_examples/math/math_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/math/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/migic_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|magic_tex|_nodeid_ukvioSsJ5E4=|-332|-18|depth|2|scale|3.0380|distortion|3.0380|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/migic_tex/migic_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/migic_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/musgrave_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|map_range|_nodeid_Y2j4GCWmFow=|-153|68|range_type|map_range_linear|value|0.0000|from_min|-1.4960|from_max|1.0000|to_min|0.0000|to_max|1.0000|steps|4.0000|node_end|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|musgrave_tex|_nodeid_ukvioSsJ5E4=|-426|-29|musgrave_type|node_tex_musgrave_fBm|dimensions|3d|w|0.0000|scale|8.8170|detail|6.0730|dimension|2.0000|lacunarity|1.4960|offset|0.0000|gain|1.0000|node_end|section_connections|_nodeid_Y2j4GCWmFow=|Result|_nodeid_LDWCIN+3B/g=|Strength|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Fac|_nodeid_Y2j4GCWmFow=|Value|
--------------------------------------------------------------------------------
/node_examples/musgrave_tex/musgrave_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/musgrave_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/noise_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|noise_tex|_nodeid_ukvioSsJ5E4=|-239|-27|dimensions|node_noise_texture_3d|w|0.0000|scale|5.0000|detail|2.0000|roughness|0.5000|distortion|0.0000|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/noise_tex/noise_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/noise_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/ramp_color.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|color_ramp|_nodeid_7vrh53kfw9U=|-286|-128|ramp|ramp00,0.0000,0.0000,0.0000,0.0000,1.0000,0.3000,0.0000,0.4762,1.0000,1.0000,0.6500,0.0000,1.0000,0.1310,1.0000,0.8000,0.9614,0.0000,0.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000|fac|0.3500|node_end|hsv|_nodeid_aRnOyq3U4OA=|-59|48|hue|0.5000|saturation|1.0000|value|1.0000|fac|1.0000|color|1.0000,1.0000,1.0000|node_end|emission|_nodeid_LDWCIN+3B/g=|16|-159|color|0.9000,0.9000,0.9000|strength|0.9500|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|section_connections|_nodeid_7vrh53kfw9U=|Color|_nodeid_aRnOyq3U4OA=|Color|_nodeid_aRnOyq3U4OA=|Color|_nodeid_LDWCIN+3B/g=|Color|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|
--------------------------------------------------------------------------------
/node_examples/ramp_color/ramp_color_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/ramp_color/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/rgb2bw.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|image_tex|_nodeid_bS4a7yaUba4=|-275|-292|interpolation_type|node_tex_image_linear_simple|projection_type|SHD_PROJ_BOX|image|meshes/Marry/MC003_Kozakura_Mari.png|node_end|rgb_to_bw|_nodeid_TJ/ep7oMRcw=|-286|19|color|0.7220,0.5882,0.5882|node_end|out_material|_nodeid_aRnOyq3U4OA=|248|-159|node_end|emission|_nodeid_xYlg2UysQDY=|-6|-125|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|section_connections|_nodeid_bS4a7yaUba4=|Color|_nodeid_xYlg2UysQDY=|Color|_nodeid_TJ/ep7oMRcw=|Val|_nodeid_xYlg2UysQDY=|Strength|_nodeid_xYlg2UysQDY=|Emission|_nodeid_aRnOyq3U4OA=|Surface|
--------------------------------------------------------------------------------
/node_examples/rgb2bw/rgb2bw_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal, a_tangent // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, VERTEX_CD_TANGENT, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | VERTEX_CD_TANGENT = a_tangent;
35 | vWorldToLight = uLightVP;
36 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/node_examples/rgb2bw/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | vec3 VERTEX_CD_TANGENT:TEXCOORD5;
6 | mat4 vWorldToLight:TEXCOORD6;
7 | vec4 vPositionFromLight:TEXCOORD7;
8 |
9 |
10 | vec3 a_position:POSITION;
11 | vec2 a_texcoord0:TEXCOORD0;
12 | vec3 a_normal:NORMAL;
13 | vec3 a_tangent:TANGENT;
14 |
--------------------------------------------------------------------------------
/node_examples/rgb_curve.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|rgb_curves|_nodeid_BQDT6eGvlTg=|-247|-22|curves|curve_rgb_00/00/0.0000,0.0000,h,1.0000,1.0000,h/0.0000,0.0000,h,1.0000,1.0000,h/0.0000,0.0000,h,1.0000,1.0000,h/0.0000,0.0000,h,1.0000,1.0000,h|fac|1.0000|color|0.7066,0.1691,0.1691|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_BQDT6eGvlTg=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/rgb_curve/rgb_curve_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/rgb_curve/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/vec_trans.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|vector_transform|_nodeid_Y2j4GCWmFow=|-78|124|transform_type|transform_point|convert_from|object|convert_to|world|vector|-0.2500,1.0000,1.0000|node_end|image_tex|_nodeid_bS4a7yaUba4=|-275|-292|interpolation_type|node_tex_image_linear_simple|projection_type|SHD_PROJ_BOX|image|meshes/Marry/MC003_Kozakura_Mari.png|node_end|rgb_to_bw|_nodeid_TJ/ep7oMRcw=|-286|19|color|0.7220,0.5882,0.5882|node_end|out_material|_nodeid_aRnOyq3U4OA=|248|-159|node_end|separate_xyz|_nodeid_xKhLRxrNOTA=|200|65|vector|0.0000,0.0000,0.0000|node_end|emission|_nodeid_xYlg2UysQDY=|-6|-125|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|section_connections|_nodeid_Y2j4GCWmFow=|Vector|_nodeid_xKhLRxrNOTA=|Vector|_nodeid_bS4a7yaUba4=|Color|_nodeid_xYlg2UysQDY=|Color|_nodeid_xKhLRxrNOTA=|X|_nodeid_xYlg2UysQDY=|Strength|_nodeid_xYlg2UysQDY=|Emission|_nodeid_aRnOyq3U4OA=|Surface|
--------------------------------------------------------------------------------
/node_examples/vec_trans/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | vec3 VERTEX_CD_TANGENT:TEXCOORD5;
6 | mat4 vWorldToLight:TEXCOORD6;
7 | vec4 vPositionFromLight:TEXCOORD7;
8 |
9 |
10 | vec3 a_position:POSITION;
11 | vec2 a_texcoord0:TEXCOORD0;
12 | vec3 a_normal:NORMAL;
13 | vec3 a_tangent:TANGENT;
14 |
--------------------------------------------------------------------------------
/node_examples/vec_trans/vec_trans_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal, a_tangent // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, VERTEX_CD_TANGENT, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | VERTEX_CD_TANGENT = a_tangent;
35 | vWorldToLight = uLightVP;
36 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/node_examples/vector_math.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|separate_xyz|_nodeid_Y2j4GCWmFow=|-229|-273|vector|0.0000,0.0000,0.0000|node_end|emission|_nodeid_LDWCIN+3B/g=|82|-190|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|combine_rgb|_nodeid_xKhLRxrNOTA=|-30|7|r|0.0000|g|0.0000|b|0.0000|node_end|vector_math|_nodeid_ukvioSsJ5E4=|-357|-36|math_type|vector_math_reflect|vector1|0.4500,0.0000,0.0000|vector2|0.0000,0.0000,0.0000|vector3|0.0000,0.0000,0.0000|scale|1.0000|node_end|section_connections|_nodeid_Y2j4GCWmFow=|X|_nodeid_xKhLRxrNOTA=|R|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_xKhLRxrNOTA=|Image|_nodeid_LDWCIN+3B/g=|Color|_nodeid_ukvioSsJ5E4=|Vector|_nodeid_Y2j4GCWmFow=|Vector|
--------------------------------------------------------------------------------
/node_examples/vector_math/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/vector_math/vector_math_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/voronoi_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|voronoi_tex|_nodeid_ukvioSsJ5E4=|-289|-86|feature|f1|dimensions|3d|w|0.0000|scale|5.0000|smoothness|1.0000|exponent|0.5000|randomness|1.0000|metric|euclidean|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/voronoi_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/voronoi_tex/voronoi_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/wave_length.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|wavelength|_nodeid_xKhLRxrNOTA=|-233|-193|wavelength|527.4450|node_end|rgb_curves|_nodeid_ukvioSsJ5E4=|-270|-52|curves|curve_rgb_00/00/0.0000,0.0000,h,1.0000,1.0000,h/0.0000,0.0000,h,0.1490,0.3490,h,0.7449,0.5922,h,1.0000,1.0000,h/0.0000,0.0000,h,1.0000,1.0000,h/0.0000,0.0000,h,1.0000,1.0000,h|fac|1.0000|color|0.0000,0.0000,0.0000|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_xKhLRxrNOTA=|Color|_nodeid_LDWCIN+3B/g=|Color|
--------------------------------------------------------------------------------
/node_examples/wave_length/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 GPU_WORLD_NORMAL:TEXCOORD3;
4 | mat4 vWorldToLight:TEXCOORD4;
5 | vec4 vPositionFromLight:TEXCOORD5;
6 |
7 |
8 | vec3 a_position:POSITION;
9 | vec2 a_texcoord0:TEXCOORD0;
10 | vec3 a_normal:NORMAL;
11 |
--------------------------------------------------------------------------------
/node_examples/wave_length/wave_length_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
32 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
33 | vWorldToLight = uLightVP;
34 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/node_examples/wave_tex.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|wave_tex|_nodeid_ukvioSsJ5E4=|-314|-72|wave_type|bands|direction|z|profile|sine|scale|5.0000|distortion|0.0000|detail|2.0000|detail_scale|1.0000|detail_roughness|0.5000|phase|0.0000|node_end|section_connections|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|_nodeid_ukvioSsJ5E4=|Fac|_nodeid_LDWCIN+3B/g=|Strength|
--------------------------------------------------------------------------------
/node_examples/wave_tex/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/wave_tex/wave_tex_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/node_examples/white_noise.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|white_noise_tex|_nodeid_Y2j4GCWmFow=|-260|20|dimensions|node_white_noise_3d|w|0.0000|node_end|emission|_nodeid_LDWCIN+3B/g=|28|-79|color|0.9000,0.9000,0.9000|strength|1.0000|node_end|out_material|_nodeid_XLuR0PaeriI=|269|-107|node_end|section_connections|_nodeid_Y2j4GCWmFow=|Value|_nodeid_LDWCIN+3B/g=|Strength|_nodeid_LDWCIN+3B/g=|Emission|_nodeid_XLuR0PaeriI=|Surface|
--------------------------------------------------------------------------------
/node_examples/white_noise/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:TEXCOORD1;
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD2;
3 | vec3 VERTEX_CD_ORCO:TEXCOORD3;
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD4;
5 | mat4 vWorldToLight:TEXCOORD5;
6 | vec4 vPositionFromLight:TEXCOORD6;
7 |
8 |
9 | vec3 a_position:POSITION;
10 | vec2 a_texcoord0:TEXCOORD0;
11 | vec3 a_normal:NORMAL;
12 |
--------------------------------------------------------------------------------
/node_examples/white_noise/white_noise_vertex.sc:
--------------------------------------------------------------------------------
1 | //--------
2 | //this vertex code generate by zhouxingxing's visual shader scirpt app
3 |
4 | //{
5 | // "u_viewRect",
6 | // "u_viewTexel",
7 | // "u_view",
8 | // "u_invView",
9 | // "u_proj",
10 | // "u_invProj",
11 | // "u_viewProj",
12 | // "u_invViewProj",
13 | // "u_model",array
14 | // "u_modelView",
15 | // "u_modelViewProj",
16 | // "u_alphaRef4",
17 | //};
18 | //Version 1.0
19 | //--------
20 |
21 | $input a_position, a_texcoord0, a_normal // in...
22 |
23 | $output GPU_WORLD_POSITION, VERTEX_CD_MTFACE, VERTEX_CD_ORCO, GPU_WORLD_NORMAL, vWorldToLight, vPositionFromLight // out...
24 |
25 | #include "../common/common.sh"
26 | #include "../node/include/share_uniform.cginc"
27 |
28 | void main(){
29 | GPU_WORLD_POSITION = mul(u_model[0] , vec4(a_position, 1.0)).xyz;
30 | VERTEX_CD_MTFACE = vec3(a_texcoord0,0.0);
31 | VERTEX_CD_ORCO = a_position;
32 | gl_Position = mul(u_modelViewProj ,vec4(a_position, 1.0));
33 | GPU_WORLD_NORMAL = mul(u_model[0] , vec4(a_normal, 0.0)).xyz;
34 | vWorldToLight = uLightVP;
35 | vPositionFromLight = uLightMVP * vec4(a_position, 1.0);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/runtime_visual_shader/.gitignore:
--------------------------------------------------------------------------------
1 | *.dll
2 | *.so
3 | *.pdb
4 | imgui*
5 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/common.sh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include
7 | #include "shaderlib.sh"
8 |
9 | #define PI 3.1415926
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/fs_font_basic.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | void main()
8 | {
9 | vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
10 | int index = int(v_texcoord0.w*4.0 + 0.5);
11 | float alpha = index < 1 ? color.z :
12 | index < 2 ? color.y :
13 | index < 3 ? color.x : color.w;
14 | gl_FragColor = vec4(v_color0.xyz, v_color0.a * alpha);
15 | }
16 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/fs_font_distance_field.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | uniform vec4 u_params;
8 |
9 | #define u_distanceMultiplier u_params.y
10 |
11 | void main()
12 | {
13 | vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
14 | int index = int(v_texcoord0.w*4.0 + 0.5);
15 | float rgba[4];
16 | rgba[0] = color.z;
17 | rgba[1] = color.y;
18 | rgba[2] = color.x;
19 | rgba[3] = color.w;
20 | float distance = rgba[index];
21 |
22 | float smoothing = 16.0 * length(fwidth(v_texcoord0.xyz)) / sqrt(2.0) * u_distanceMultiplier;
23 |
24 | float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
25 | vec4 sdfColor = vec4(v_color0.xyz, alpha * v_color0.w);
26 | gl_FragColor = sdfColor;
27 | }
28 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/fs_font_distance_field_outline.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_color1, v_texcoord0, v_texcoord1
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | uniform vec4 u_params;
8 |
9 | #define u_distanceMultiplier u_params.y
10 | #define u_outlineWidth u_params.w
11 |
12 | void main()
13 | {
14 | vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
15 |
16 | int index = int(v_texcoord0.w*4.0 + 0.5);
17 | float rgba[4];
18 | rgba[0] = color.z;
19 | rgba[1] = color.y;
20 | rgba[2] = color.x;
21 | rgba[3] = color.w;
22 | float distance = rgba[index];
23 |
24 | float smoothing = 16.0 * length(fwidth(v_texcoord0.xyz)) / sqrt(2.0) * u_distanceMultiplier;
25 |
26 | float outlineWidth = u_outlineWidth * smoothing;
27 | float outerEdgeCenter = 0.5 - outlineWidth;
28 | float alpha = smoothstep(outerEdgeCenter - smoothing, outerEdgeCenter + smoothing, distance);
29 | float border = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
30 | vec4 sdfColor = vec4( mix(v_color1.xyz, v_color0.xyz, border), alpha * v_color0.w );
31 | gl_FragColor = sdfColor;
32 | }
33 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/fs_font_distance_field_subpixel.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | void main()
8 | {
9 | int index = int(v_texcoord0.w*4.0 + 0.5);
10 | vec3 dx3 = dFdx(v_texcoord0.xyz);
11 | vec3 dy3 = dFdy(v_texcoord0.xyz);
12 | vec3 decal = 0.166667 * dx3;
13 | vec3 sampleLeft = v_texcoord0.xyz - decal;
14 | vec3 sampleRight = v_texcoord0.xyz + decal;
15 |
16 | float left_dist = textureCube(s_texColor, sampleLeft).zyxw[index];
17 | float right_dist = textureCube(s_texColor, sampleRight).zyxw[index];
18 |
19 | float dist = 0.5 * (left_dist + right_dist);
20 |
21 | float dx = length(dx3);
22 | float dy = length(dy3);
23 | float w = 16.0*0.5*(dx+dy);
24 |
25 | vec3 sub_color = smoothstep(0.5 - w, 0.5 + w, vec3(left_dist, dist, right_dist));
26 | gl_FragColor.xyz = sub_color*v_color0.w;
27 | gl_FragColor.w = dist*v_color0.w;
28 | }
29 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec2 a_position : POSITION;
2 | vec4 a_color0 : COLOR0;
3 | vec4 a_color1 : COLOR1;
4 | vec4 a_texcoord0 : TEXCOORD0;
5 | vec4 a_texcoord1 : TEXCOORD1;
6 | vec4 a_texcoord2 : TEXCOORD2;
7 |
8 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
9 | vec4 v_color1 : COLOR1 = vec4(1.0, 0.0, 0.0, 1.0);
10 | vec4 v_texcoord0 : TEXCOORD0 = vec4(0.0, 0.0, 0.0, 0.0);
11 | vec4 v_texcoord1 : TEXCOORD1 = vec4(0.0, 0.0, 0.0, 0.0);
12 | vec4 v_texcoord2 : TEXCOORD2 = vec4(0.0, 0.0, 0.0, 0.0);
13 | vec4 v_sampleLeft : TEXCOORD1 = vec4(0.0, 0.0, 0.0, 0.0);
14 | vec4 v_sampleRight : TEXCOORD2 = vec4(0.0, 0.0, 0.0, 0.0);
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_basic.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_color0 = a_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_color0 = a_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field_drop_shadow.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1, a_texcoord2
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1, v_texcoord2
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_texcoord2 = a_texcoord2;
12 | v_color0 = a_color0;
13 | v_color1 = a_color1;
14 | }
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field_drop_shadow_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1, a_texcoord2
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1, v_texcoord2
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_texcoord2 = a_texcoord2;
12 | v_color0 = a_color0;
13 | v_color1 = a_color1;
14 | }
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field_outline.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_color0 = a_color0;
12 | v_color1 = a_color1;
13 | }
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field_outline_drop_shadow_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1, a_texcoord2
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1, v_texcoord2
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_texcoord2 = a_texcoord2;
12 | v_color0 = a_color0;
13 | v_color1 = a_color1;
14 | }
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field_outline_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_color0 = a_color0;
12 | v_color1 = a_color1;
13 | }
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/font/vs_font_distance_field_subpixel.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_color0 = a_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/ps/fs_particle.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | SAMPLER2D(s_texColor, 0);
11 |
12 | void main()
13 | {
14 | vec4 rgba = texture2D(s_texColor, v_texcoord0.xy).xxxx;
15 |
16 | rgba.xyz = rgba.xyz * v_color0.xyz * rgba.w * v_color0.w;
17 | rgba.w = rgba.w * v_color0.w * (1.0f - v_texcoord0.z);
18 | gl_FragColor = rgba;
19 | }
20 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/ps/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec4 v_texcoord0 : TEXCOORD0 = vec4(0.0, 0.0, 0.0, 0.0);
3 |
4 | vec3 a_position : POSITION;
5 | vec4 a_color0 : COLOR0;
6 | vec4 a_texcoord0 : TEXCOORD0;
7 |
--------------------------------------------------------------------------------
/runtime_visual_shader/common/ps/vs_particle.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_color0 = a_color0;
15 | v_texcoord0 = a_texcoord0;
16 | }
17 |
--------------------------------------------------------------------------------
/runtime_visual_shader/font/NotoEmoji-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/NotoEmoji-Regular.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/bleeding_cowboys.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/bleeding_cowboys.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/chp-fire.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/chp-fire.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/droidsans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/droidsans.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/droidsansmono.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/droidsansmono.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/entypo.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/five_minutes.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/five_minutes.otf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/glyph_long.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/glyph_long.png
--------------------------------------------------------------------------------
/runtime_visual_shader/font/glyph_space.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/glyph_space.png
--------------------------------------------------------------------------------
/runtime_visual_shader/font/kenney-icon-font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/kenney-icon-font.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/mias_scribblings.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/mias_scribblings.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/roboto-bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/roboto-bold.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/roboto-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/roboto-regular.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/robotomono-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/robotomono-regular.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/ruritania.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/ruritania.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/signika-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/signika-regular.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/special_elite.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/special_elite.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/font/visitor1.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/font/visitor1.ttf
--------------------------------------------------------------------------------
/runtime_visual_shader/meshes/Marry/MC003_Kozakura_Mari.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/meshes/Marry/MC003_Kozakura_Mari.png
--------------------------------------------------------------------------------
/runtime_visual_shader/meshes/Marry/Marry.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'Marry.blend'
2 | # Material Count: 2
3 |
4 | newmtl MC003_Kozakura_Mari
5 | Ns 900.000000
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.800000 0.800000 0.800000
8 | Ks 0.000000 0.000000 0.000000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.450000
11 | d 1.000000
12 | illum 1
13 | map_Kd MC003_Kozakura_Mari.png
14 |
15 | newmtl 材质
16 | Ns 900.000000
17 | Ka 1.000000 1.000000 1.000000
18 | Kd 0.270588 0.552941 0.874510
19 | Ks 0.000000 0.000000 0.000000
20 | Ke 0.000000 0.000000 0.000000
21 | Ni 1.450000
22 | d 1.000000
23 | illum 1
24 |
--------------------------------------------------------------------------------
/runtime_visual_shader/meshes/Marry/hmap.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/meshes/Marry/hmap.jpg
--------------------------------------------------------------------------------
/runtime_visual_shader/meshes/spot/hmap.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/meshes/spot/hmap.jpg
--------------------------------------------------------------------------------
/runtime_visual_shader/meshes/spot/spot_texture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/meshes/spot/spot_texture.png
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 293c44d7dd6c02147bf2dd328ffbb607
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_brightness_contrast.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_brightness_contrast_api
7 | #define node_brightness_contrast_api
8 | #include "../include/base_h.cginc"
9 |
10 | /*
11 | 颜色校正Color Adjustments
12 | 亮度(brightness)
13 | 明暗对比(contrast)
14 | */
15 | void node_brightness_contrast(float4 col, float brightness, float contrast, out float4 outcol)
16 | {
17 | float a = 1.0 + contrast;
18 | float b = brightness - contrast * 0.5;
19 |
20 | outcol.r = max(a * col.r + b, 0.0);
21 | outcol.g = max(a * col.g + b, 0.0);
22 | outcol.b = max(a * col.b + b, 0.0);
23 | outcol.a = col.a;
24 | }
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_brightness_contrast.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 675cdadf3bb1d9a47a41481bc02e41cc
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_curves_rgb.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e3630f61377627f4ea92dfe146a4078a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_gamma.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_gamma_api
7 | #define node_gamma_api
8 | #include "../include/base_h.cginc"
9 |
10 | void node_gamma(float4 ColorIn , float Gamma ,out float4 ColorOut)
11 | {
12 | ColorOut = pow(ColorIn, Gamma);
13 | }
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_gamma.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7ca6810ac53b03646a5849de1a946a33
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_hsv.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_hsv_api
8 | #define node_hsv_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_hsv(float Hue ,
13 | float Saturation ,
14 | float Value ,
15 | float Fac ,
16 | float4 ColorIn ,
17 | out float4 ColorOut)
18 | {
19 | float4 Color;
20 | rgb_to_hsv(ColorIn,Color);
21 |
22 | // remember: fmod doesn't work for negative numbers
23 | Color[0] = mod(Color[0] + Hue + 0.5, 1.0);
24 | Color[1] = clamp(Color[1] * Saturation, 0.0, 1.0);
25 | Color[2] *= Value;
26 |
27 | hsv_to_rgb(Color,Color);
28 |
29 | // Clamp color to prevent negative values cauzed by oversaturation.
30 | Color[0] = max(Color[0], 0.0);
31 | Color[1] = max(Color[1], 0.0);
32 | Color[2] = max(Color[2], 0.0);
33 |
34 | ColorOut = lerp(ColorIn, Color, Fac);
35 | }
36 | #endif
37 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_hsv.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1bdf308c9d325e24fac9de798069e4ac
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_invert.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_invert_api
8 | #define node_invert_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_invert(float Fac , float4 ColorIn ,
13 | out float4 ColorOut)
14 | {
15 | float4 ColorInv = 1.0 - ColorIn;
16 | ColorOut = lerp(ColorIn, ColorInv, Fac);
17 | }
18 | #endif
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_invert.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0849c6e1391bd7048a19c1424a5a74ff
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_light_falloff.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_light_falloff_api
8 | #define node_light_falloff_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | /*
13 |
14 | 不支持,因为没有点光源
15 |
16 | */
17 | void node_light_falloff(float Strength ,
18 | float Smooth ,
19 | out float Quadratic ,
20 | out float Linear ,
21 | out float Constant )
22 | {
23 | // float ray_length = 0.0;
24 | float strength = Strength;
25 | float ray_length = 1.0;
26 | //getattribute("path:ray_length", ray_length);
27 |
28 | if (Smooth > 0.0) {
29 | float squared = ray_length * ray_length;
30 | strength *= squared / (Smooth + squared);
31 | }
32 |
33 | /* Quadratic */
34 | Quadratic = strength;
35 |
36 | /* Linear */
37 | Linear = (strength * ray_length);
38 |
39 | /* Constant */
40 | Constant = (strength * ray_length * ray_length);
41 | }
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_light_falloff.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3509a76bc9a2abe47bfbde22bd61f0bd
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/color/node_mix.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ede1772c1dc4df940803df8f4b535ce2
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f1a7a758fc205f645bca1cc8ddf1a7ea
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_blackbody.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_blackbody_api
8 | #define node_blackbody_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | //https://docs.unity3d.com/Packages/com.unity.shadergraph@8.0/manual/Blackbody-Node.html
13 | //https://github.com/glslify/glsl-colormap/blob/master/readme.md
14 | //= 1200.0
15 | void node_blackbody(float Temperature , out float4 col)
16 | {
17 | float3 color = float3(255.0, 255.0, 255.0);
18 | color.x = 56100000. * pow(Temperature,(-3.0 / 2.0)) + 148.0;
19 | color.y = 100.04 * log(Temperature) - 623.6;
20 | if (Temperature > 6500.0) {color.y = 35200000.0 * pow(Temperature,(-3.0 / 2.0)) + 184.0;}
21 | color.z = 194.18 * log(Temperature) - 1448.6;
22 | color = clamp(color, 0.0, 255.0)/255.0;
23 | if (Temperature < 1000.0) {color *= Temperature/1000.0;}
24 |
25 | col = float4(color,1.0);
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_blackbody.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c450e443b0411f04db593cacc06ee081
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_clamp.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_clamp_h
7 | #define node_clamp_h
8 |
9 | /*
10 | clamp值
11 | */
12 |
13 | void clamp_value(float value, float min, float max, out float result)
14 | {
15 | result = clamp(value, min, max);
16 | }
17 |
18 | void clamp_minmax(float value, float min_allowed, float max_allowed, out float result)
19 | {
20 | result = min(max(value, min_allowed), max_allowed);
21 | }
22 |
23 | void clamp_range(float value, float min, float max, out float result)
24 | {
25 | result = (max > min) ? clamp(value, min, max) : clamp(value, max, min);
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_clamp.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fd3d3992ec00a3e45940517c6d5b329a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_color_ramp.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 05175fcdee6b6fe4b9efaa7f4f3862f0
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_combine_hsv.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_combine_hsv_api
8 | #define node_combine_hsv_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_combine_hsv(float h, float s, float v, out float4 col)
13 | {
14 | hsv_to_rgb(float4(h, s, v, 1.0), col);
15 | }
16 |
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_combine_hsv.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 461a8c5038f2c7348a28b579aa715a8f
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_combine_rgb.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_combine_rgb_api
8 | #define node_combine_rgb_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_combine_rgb(float r, float g, float b, out float4 col)
13 | {
14 | col = float4(r, g, b, 1.0);
15 | }
16 |
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_combine_rgb.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 00f6f4bb0d4cd644982e8073dfa7e0c3
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_combine_xyz.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_combine_xyz_api
8 | #define node_combine_xyz_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_combine_xyz(float x, float y, float z, out float4 vec)
13 | {
14 | vec = float4(x, y, z,1.0);
15 | }
16 |
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_combine_xyz.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5a1399d8d23a89546a3b12c1b9bfa5f7
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_map_range.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1037fcca217f8b5458e3336bd8f42949
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_math.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f9366f94c36a69949ba776eb8a0edc07
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_rgbtobw.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_rgbtobw_api
8 | #define node_rgbtobw_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | /*
13 | https://www.rapidtables.com/convert/image/rgb-to-grayscale.html
14 | 颜色转换为灰度
15 | */
16 | void node_rgbtobw(float4 color, out float outval)
17 | {
18 | vec3 factors = vec3(0.2126, 0.7152, 0.0722);
19 | outval = dot(color.rgb, factors);
20 | }
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_rgbtobw.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: da786ff4bea9fad47ab427e10cabff99
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_separate_hsv.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_separate_hsv_api
8 | #define node_separate_hsv_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_separate_hsv(float4 col, out float h, out float s, out float v)
13 | {
14 | float4 hsv;
15 |
16 | rgb_to_hsv(col, hsv);
17 | h = hsv[0];
18 | s = hsv[1];
19 | v = hsv[2];
20 | }
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_separate_hsv.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f9e7bf93005b8b049bd0b3cfa541c732
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_separate_rgb.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_separate_rgb_api
8 | #define node_separate_rgb_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_separate_rgb(float4 col, out float r, out float g, out float b)
13 | {
14 | r = col.r;
15 | g = col.g;
16 | b = col.b;
17 | }
18 |
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_separate_rgb.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e713541e0254e14a9e598a65d1c3598
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_separate_xyz.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_separate_xyz_api
8 | #define node_separate_xyz_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_separate_xyz(float3 vec, out float x, out float y, out float z)
13 | {
14 | x = vec.r;
15 | y = vec.g;
16 | z = vec.b;
17 | }
18 |
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_separate_xyz.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7b6094d072ca7a84b823e670e7784c23
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_vector_math.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ed167de348b8b6d4899f4e7885ffb70b
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_wavelength.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_wavelength_h
7 | #define node_wavelength_h
8 |
9 | /*
10 | https://docs.blender.org/manual/en/latest/render/shader_nodes/converter/wavelength.html
11 | */
12 | //limited 380-780
13 | void node_wavelength(float wavelength,
14 | float layer,
15 | out vec4 color)
16 | {
17 | //mat3 xyz_to_rgb = mat3(xyz_to_r, xyz_to_g, xyz_to_b);
18 | float t = (wavelength - 380.0) / (780.0 - 380.0);
19 | vec3 xyz = texture2D(ramp_curve, vec2(t, layer)).rgb;
20 | vec3 rgb = xyz_to_rgb(xyz);
21 | rgb *= 1.0 / 2.52; /* Empirical scale from lg to make all comps <= 1. */
22 | color = vec4(clamp(rgb, 0.0, 1.0), 1.0);
23 | }
24 |
25 | /*
26 | void Unity_NoiseSineWave_float4(float4 In, float2 MinMax, out float4 Out)
27 | {
28 | float sinIn = sin(In);
29 | float sinInOffset = sin(In + 1.0);
30 | float randomno = frac(sin((sinIn - sinInOffset) * (12.9898 + 78.233))*43758.5453);
31 | float noise = lerp(MinMax.x, MinMax.y, randomno);
32 | Out = sinIn + noise;
33 | }
34 | */
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/converter/node_wavelength.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f678f14f951a0b24bbab6f4a762b32be
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f472b2c1ed24c8d45bde726bc4940981
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/base_h.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef base_h
7 | #define base_h
8 | #include "define_h.cginc"
9 | #include "color_h.cginc"
10 | #include "texture_def_h.cginc"
11 | #include "math_util_h.cginc"
12 | #include "hash_util_h.cginc"
13 | #include "noise_util_h.cginc"
14 | #include "fractal_noise_util_h.cginc"
15 | #include "light_h.cginc"
16 |
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/base_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a6ac9cc2d22fbca49b6867353750c75e
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/color_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ac59f6e9206ce1f45aea89bcd415e5db
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/define_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4708dcdcb27c9394cabee2ff70e1318a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/exe_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 20a8a130a94ecd145a0e9c10b0450d98
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/fractal_noise_util_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 32bf7eaa1e4750e488036921e642468a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/hash_util_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 408f4e5e89905e149863b293507efcf9
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/light_h.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef light_h
7 | #define light_h
8 | #include "define_h.cginc"
9 |
10 |
11 |
12 |
13 | uniform sampler3D utilTex;
14 |
15 |
16 |
17 | #define LUT_SIZE 64
18 |
19 | #define LTC_MAT_LAYER 0
20 | #define LTC_BRDF_LAYER 1
21 | #define BRDF_LUT_LAYER 1
22 | #define NOISE_LAYER 2
23 | #define LTC_DISK_LAYER 3 /* UNUSED */
24 |
25 | /**
26 | * Reminder: The 4 noise values are based of 3 uncorrelated blue noises:
27 | * x : Uniformly distributed value [0..1] (noise 1).
28 | * y : Uniformly distributed value [0..1] (noise 2).
29 | * z,w : Uniformly distributed point on the unit circle [-1..1] (noise 3).
30 | */
31 | #define texelfetch_noise_tex(coord) texelFetch3D(utilTex, vec3(vec2(coord) % LUT_SIZE,2.0),0.0)
32 |
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/light_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9b69fe898212f1544b65883a6c1da448
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/math_util_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2ddfa66f14070634f9ee0c46e3b87593
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/noise_util_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5ad8a6e40c53f924099e1f69e516fda3
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/share_uniform.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef share_uniform_h
7 | #define share_uniform_h
8 |
9 | uniform float4x4 uLightMVP;
10 | uniform float4x4 uLightVP;
11 | uniform float4 uLightDir;
12 | uniform float4 uLightPos;
13 | uniform float4 uLightRadiance;
14 | uniform float4 GPU_OBJECT_COLOR;//from engine settting nothing todo for bgfx
15 | uniform float4 GPU_OBJECT_INFO;//from engine settting nothing todo for bgfx,z=hue,x=obj_index,w=flag
16 | uniform float4 GPU_OBJECT_MAT_INDEX;//from engine settting nothing todo for bgfx
17 |
18 | // uniform float2 GPU_VIEW_POSITION;
19 | // uniform float4 GPU_WORLD_NORMAL;
20 | // uniform float4 GPU_WORLD_POSITION;
21 |
22 | // uniform float3 VERTEX_CD_ORCO;
23 | // uniform float3 VERTEX_CD_MTFACE;//UV 坐标
24 | // uniform float3 VERTEX_CD_MCOL;// Color
25 | // uniform float3 VERTEX_CD_TANGENT;
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/share_uniform.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 259e7ece9b2f8e546b6b0103c2da0564
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/texture_def_h.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef texture_def_h
7 | #define texture_def_h
8 |
9 |
10 | #ifdef UNITY_CG_INCLUDED
11 | #else
12 | // SAMPLER2D(texture_diffuse,0);
13 | SAMPLER2D(ramp_curve,9);
14 | #endif
15 |
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/include/texture_def_h.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 12ed49b726a145d4aa887430b19ee768
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: eff83caeab8fed74e99d558ed287ab03
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_ambient_occlusion.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b35bf9d703964544da195635c17ca438
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_bevel.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_bevel_api
8 | #define node_bevel_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 | /*
12 |
13 | */
14 | void node_bevel(float samples,float radius, vec3 GPU_WORLD_NORMAL, out vec3 result)
15 | {
16 | result = GPU_WORLD_NORMAL;
17 | }
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_bevel.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 60999ea1c3682b546805de64e2ff1028
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_camera.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_camera_api
8 | #define node_camera_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 | /*
12 | viewDir 默认世界空间视方向 隐藏节点
13 | */
14 | void node_camera(vec3 GPU_WORLD_POSITION , out float4 ViewVector ,
15 | out float ViewZDepth ,
16 | out float ViewDistance)
17 | {
18 | vec3 viewDir = cameraVec(GPU_WORLD_POSITION);
19 | ViewVector.xyz = viewDir.xyz;
20 |
21 | ViewZDepth = abs(viewDir[2]);
22 | ViewDistance = length(viewDir);
23 |
24 | ViewVector.xyz = normalize(viewDir);
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_camera.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 772bdc8e2bf48b64e89ed444314758d9
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_fresnel.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: acdf69d589161574992cc7e695225b1a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_geometry.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 583e28d09694df54ab2ab9594a524dd7
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_layer_weight.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 499f54c5ed7cbfa489c3714177af5e0a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_light_path.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e3b5e29c810b35742805f16c424e61d1
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_object_info.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_object_info_api
8 | #define node_object_info_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 | /*
12 | GPU_OBJECT_INFO?
13 | */
14 | void node_object_info(vec4 GPU_OBJECT_COLOR,
15 | vec4 GPU_OBJECT_INFO,
16 | float GPU_OBJECT_MAT_INDEX,
17 | out vec3 location,
18 | out vec4 color,
19 | out float object_index,
20 | out float material_index,
21 | out float random)
22 | {
23 | location = objmat[3].xyz;
24 | color = GPU_OBJECT_COLOR;
25 | object_index = GPU_OBJECT_INFO.x;
26 | material_index = GPU_OBJECT_MAT_INDEX;
27 | random = GPU_OBJECT_INFO.z;
28 | }
29 |
30 |
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_object_info.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ff747f48de4754f4f8076d28e7f1a831
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_rgb.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_rgb_api
8 | #define node_rgb_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 | /*
12 | GPU_OBJECT_INFO?
13 | */
14 | void node_rgb(vec3 invec,inout vec4 color)
15 | {
16 | color = vec4(invec,1.0);
17 | }
18 |
19 |
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_rgb.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6ff019a8466c0ea409f048bba34ab17a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_tangent.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 57b76905bc8fb5c48a21c1b721d1037c
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_tex_coord.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5d64bbdafbeb4f74aa578edc54689555
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_value.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_value_api
8 | #define node_value_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_value(float invalue,out float ret)
13 | {
14 | ret = invalue;
15 | }
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_value.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c2575919e17f62447b0781af5c1409f8
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_vertex_color.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_vertex_color_api
8 | #define node_vertex_color_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | void node_vertex_color(float4 invalue,out float3 ret,out float alpha)
13 | {
14 | ret = invalue.xyz;
15 | alpha = invalue.w;
16 | }
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_vertex_color.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a5ba73819c026cf44b00c8d8a783795f
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/input/node_wireframe.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 915839a0414a8614db3c95f1aa86c97a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f90f0e2a483fc424c9c0d405ad3893ca
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light/closure_eval_lib.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef closure_eval_lib_h
7 | #define closure_eval_lib_h
8 |
9 | #include "../include/base_h.cginc"
10 | #include "clusure_data_lib.sh"
11 |
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light/closure_eval_lib.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6839fa2e622eb374d89ead3967ffd033
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light/clusure_data_lib.sh.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 694de075491725148b4d2478adaad3ac
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light/eval_diffuse_lib.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef closure_eval_diffuse_lib_h
7 | #define closure_eval_diffuse_lib_h
8 | #include "../include/base_h.cginc"
9 | #include "closure_eval_lib.cginc"
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light/eval_diffuse_lib.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c34dc7fbe110bed418f9ef2b34667337
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/light/eval_surface_lib.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 58e5db3a5d19d12409e6a396e6bed557
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/node.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e40db77d37b333f468dd19553359db3a
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b61263fe55deefb4699341dbc08a5d9a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_add_shader.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_add_shader_h
7 | #define node_add_shader_h
8 |
9 | #include "../include/base_h.cginc"
10 | #include "../light/closure_eval_lib.cginc"
11 |
12 | void node_add_shader(Closure shader1, Closure shader2, out Closure shader)
13 | {
14 | shader = closure_add(shader1, shader2);
15 | }
16 | #endif
17 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_bsdf_anisotropic.cginc:
--------------------------------------------------------------------------------
1 | #ifndef node_bsdf_anisotropic_h
2 | #define node_bsdf_anisotropic_h
3 |
4 | #include "../include/base_h.cginc"
5 | #include "../light/closure_eval_lib.cginc"
6 |
7 | // #ifndef VOLUMETRICS
8 | // void node_bsdf_anisotropic(vec4 color,
9 | // float roughness,
10 | // float anisotropy,
11 | // float rotation,
12 | // vec3 N,
13 | // vec3 T,
14 | // const float use_multiscatter,
15 | // const float ssr_id,
16 | // out Closure result)
17 | // {
18 | // node_bsdf_glossy(color, roughness, N, use_multiscatter, ssr_id, result);
19 | // }
20 | // #else
21 | // /* Stub anisotropic because it is not compatible with volumetrics. */
22 | // # define node_bsdf_anisotropic(a, b, c, d, e, f, g, h, result) (result = CLOSURE_DEFAULT)
23 | // #endif
24 |
25 |
26 | #endif
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_bsdf_diffuse.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_bsdf_diffuse_h
7 | #define node_bsdf_diffuse_h
8 |
9 | #include "../include/base_h.cginc"
10 | #include "../light/eval_diffuse_lib.cginc"
11 |
12 |
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_bsdf_diffuse.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9b41e4a80d92d8743a765dedf86c2720
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_bsdf_emission.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_bsdf_emission_h
7 | #define node_bsdf_emission_h
8 |
9 | #include "../include/base_h.cginc"
10 | #include "../light/closure_eval_lib.cginc"
11 |
12 |
13 | void node_bsdf_emission(vec4 color, float strength, out Closure result){
14 | result.radiance = uLightRadiance*color*strength;
15 | }
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_bsdf_surface.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d5644b3c646b028448379cb727e0ff31
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/shader/node_mix_shader.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_mix_shader_h
7 | #define node_mix_shader_h
8 |
9 | #include "../include/base_h.cginc"
10 | #include "../light/closure_eval_lib.cginc"
11 |
12 | void node_mix_shader(float fac, Closure shader1, Closure shader2, out Closure shader)
13 | {
14 | shader = closure_mix(shader1, shader2, fac);
15 | }
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8519cfe424a144a44a1384b7c599362d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_brick.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 099606b8f67c53a438e0ff4500659bb9
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_checker.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #ifndef node_tex_checker_api
7 | #define node_tex_checker_api
8 |
9 | #include "../include/base_h.cginc"
10 |
11 | /*
12 | 用于添加一个棋盘纹理,
13 | Vector,如果未连接,默认为纹理坐标
14 | https://docs.blender.org/manual/en/latest/render/shader_nodes/textures/checker.html
15 | */
16 |
17 | //1.没有输入的时候,使用默认顶点的偏导数得到的新位置0 dx方向的新位置,1 dy方向的新位置
18 | //2.node_shader_gpu_tex_mapping做 如果有贴图映射,使用贴图的matrix重新生成新的向量,
19 |
20 | void node_tex_checker(
21 | float3 co, float4 color1, float4 color2, float scale, out float4 color, out float fac)
22 | {
23 | float3 p = co * scale;
24 |
25 | /* Prevent precision issues on unit coordinates. */
26 | p = (p + 0.000001) * 0.999999;
27 |
28 | int xi = int(abs(floor(p.x)));
29 | int yi = int(abs(floor(p.y)));
30 | int zi = int(abs(floor(p.z)));
31 |
32 | bool check = ((mod(xi, 2) == mod(yi, 2)) == bool(mod(zi, 2)));
33 |
34 | color = check ? color1 : color2;
35 | fac = check ? 1.0 : 0.0;
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_checker.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7888569a432d29e489054a295a88ae8e
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_gradient.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: de5bf0ab38e73484d9de0a9085a30c2b
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_image.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 777832e139cdc8848aca6719d2235ca3
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_magic.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2c46fe0956cd2ba40b134f8377ee7bef
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_musgrave.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 603987bee6a366544a00b53a88ff3355
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_noise.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fde21e1fb95d18b4780a3419d280f1e7
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_voronoi.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8624b1f73dd44f041b3b4eb86edcc2eb
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_wave.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 925fbe10a5e867444944cebc529abbcf
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/texture/node_tex_white_noise.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 270f1806e88b0c8499bc4a6fa525a59b
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dfd9293911c55b947a8583f34937fc06
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_bump.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: af8ee98d057e4cb49a32c2c6000c7a3f
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_displacement.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_displacement_api
8 | #define node_displacement_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | /*
13 | https://docs.blender.org/manual/en/latest/render/shader_nodes/vector/displacement.html
14 | 置换贴图,只要是根据置换贴图更新了原始的顶点,添加更多的细节效果
15 | 顶点根据置换贴图凸起或者内凹,产生部分边缘效果
16 |
17 | *:更新了原始的顶点:*
18 | */
19 | void node_displacement_object(
20 | float height, float midlevel, float scale, vec3 N, out vec3 result)
21 | {
22 | //因为传入的默认法线值是被计算过的世界空间值,先变化到对象空间
23 | N = mul(vec4(N, 0.0) , objmat).xyz;
24 |
25 | //法线延伸
26 | result = (height - midlevel) * scale * normalize(N);
27 |
28 | //对象空间转换到世界空间
29 | result = mul(objmat , vec4(result, 0.0)).xyz;
30 | }
31 |
32 | void node_displacement_world(float height, float midlevel, float scale, vec3 N, out vec3 result)
33 | {
34 | result = (height - midlevel) * scale * normalize(N);
35 | }
36 |
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_displacement.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fbb80ab7fe298ef4690491ed7a827489
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_mapping.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2540942508112a54f8e96c055a8f55ca
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_normal.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 |
7 | #ifndef node_normal_api
8 | #define node_normal_api
9 | //#include "UnityCG.cginc"
10 | #include "../include/base_h.cginc"
11 |
12 | /*
13 |
14 | https://docs.blender.org/manual/en/latest/render/shader_nodes/vector/normal.html
15 | 法向量节点生成一个法向量和一个点积。
16 | */
17 |
18 | void node_normal(vec3 nor, vec3 dir, out vec3 outnor, out float outdot)
19 | {
20 | outnor = dir;
21 | outdot = dot(normalize(nor), dir);
22 | }
23 |
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_normal.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b1d57705016abd34d9bbda710065e4f1
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_normal_map.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f3086c38701780b4b9461efc1d321287
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_vector_curves.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2463bbc2420caba4e8cbcac90e985c9c
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_vector_displacement.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a697c2d9296c97042b56ebcbd44bf2d4
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_vector_rotate.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: eec538e9b32b6c449b5188fbda32a2a6
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/node/vector/node_vector_transform.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 32d170215f4694141afee2c5e1ecf160
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/runtime_visual_shader/osx-info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHighResolutionCapable
28 | True
29 |
30 |
31 |
--------------------------------------------------------------------------------
/runtime_visual_shader/shader_graph/pbr.nodedata:
--------------------------------------------------------------------------------
1 | cycles_shader|1|section_nodes|image_tex|_nodeid_bS4a7yaUba4=|-353|-288|interpolation_type|node_tex_image_linear_simple|projection_type|SHD_PROJ_BOX|image|/Users/zhouwei/Documents/GitHub/visual-shader-graph/runtime_visual_shader/meshes/spot/spot_texture.png|node_end|out_material|_nodeid_aRnOyq3U4OA=|177|-152|node_end|pbr|_nodeid_s8R4+DcBKvs=|-88|-18|albedo|1.0000,0.9653,0.9653|specular|0.4903,0.1155,0.1155|emission|0.0000,0.0000,0.0000|smoothness|0.6930|node_end|section_connections|_nodeid_bS4a7yaUba4=|Color|_nodeid_s8R4+DcBKvs=|Albedo|_nodeid_s8R4+DcBKvs=|BSDF|_nodeid_aRnOyq3U4OA=|Surface|
--------------------------------------------------------------------------------
/runtime_visual_shader/shader_graph/pbr/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 GPU_WORLD_POSITION:POSITION=vec3(0.0,0.0,0.0);
2 | vec3 VERTEX_CD_MTFACE:TEXCOORD0=vec3(0.0,0.0,0.0);
3 | vec3 VERTEX_CD_ORCO:TEXCOORD1=vec3(0.0,0.0,0.0);
4 | vec3 GPU_WORLD_NORMAL:TEXCOORD2=vec3(0.0,0.0,0.0);
5 | vec4 VERTEX_CD_TANGENT:TEXCOORD3=vec4(0.0,0.0,0.0,0.0);
6 | mat4 vWorldToLight:TEXCOORD4=0.0;
7 | vec4 vPositionFromLight:TEXCOORD5=vec4(0.0,0.0,0.0,0.0);
8 |
9 |
10 | vec3 a_position:POSITION;
11 | vec2 a_texcoord0:TEXCOORD0;
12 | vec3 a_normal:NORMAL;
13 | vec4 a_tangent:TANGENT;
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/essl/fs_cubes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/essl/fs_cubes.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/essl/fs_hdr_skybox.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/essl/fs_hdr_skybox.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/essl/vs_cubes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/essl/vs_cubes.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/essl/vs_hdr_skybox.bin:
--------------------------------------------------------------------------------
1 | VSH o>< u_modelViewProj , attribute highp vec3 a_position;
2 | attribute highp vec2 a_texcoord0;
3 | varying highp vec2 v_texcoord0;
4 | uniform highp mat4 u_modelViewProj;
5 | void main ()
6 | {
7 | highp vec4 tmpvar_1;
8 | tmpvar_1.w = 1.0;
9 | tmpvar_1.xyz = a_position;
10 | gl_Position = (u_modelViewProj * tmpvar_1);
11 | v_texcoord0 = a_texcoord0;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/metal/fs_cubes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/metal/fs_cubes.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/metal/fs_hdr_skybox.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/metal/fs_hdr_skybox.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/metal/vs_cubes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/metal/vs_cubes.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/shaders/metal/vs_hdr_skybox.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/shaders/metal/vs_hdr_skybox.bin
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/cubes/fs_cubes.sc:
--------------------------------------------------------------------------------
1 | $input v_color0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include "../common/common.sh"
9 |
10 | void main()
11 | {
12 | gl_FragColor = vec4(1.0,0.0,0.0,1.0);
13 | }
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/cubes/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 |
3 | vec3 a_position : POSITION;
4 | vec4 a_color0 : COLOR0;
5 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/cubes/vs_cubes.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0
2 | $output v_color0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include "../common/common.sh"
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_color0 = a_color0;
15 | }
16 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/mesh/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
3 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
4 | vec3 v_pos : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
5 | vec3 v_view : TEXCOORD2 = vec3(0.0, 0.0, 0.0);
6 |
7 | vec3 a_position : POSITION;
8 | vec4 a_color0 : COLOR0;
9 | vec2 a_texcoord0 : TEXCOORD0;
10 | vec3 a_normal : NORMAL;
11 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/mesh/vs_mesh.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_normal
2 | $output v_pos, v_view, v_normal, v_color0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include "../common/common.sh"
10 |
11 | uniform vec4 u_time;
12 |
13 | void main()
14 | {
15 | vec3 pos = a_position;
16 |
17 | float sx = sin(pos.x*32.0+u_time.x*4.0)*0.5+0.5;
18 | float cy = cos(pos.y*32.0+u_time.x*4.0)*0.5+0.5;
19 | vec3 displacement = vec3(sx, cy, sx*cy);
20 | vec3 normal = a_normal.xyz*2.0 - 1.0;
21 |
22 | pos = pos + normal*displacement*vec3(0.06, 0.06, 0.06);
23 |
24 | gl_Position = mul(u_modelViewProj, vec4(pos, 1.0) );
25 | v_pos = gl_Position.xyz;
26 | v_view = mul(u_modelView, vec4(pos, 1.0) ).xyz;
27 |
28 | v_normal = mul(u_modelView, vec4(normal, 0.0) ).xyz;
29 |
30 | float len = length(displacement)*0.4+0.6;
31 | v_color0 = vec4(len, len, len, 1.0);
32 | }
33 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/role/fs_role.sc:
--------------------------------------------------------------------------------
1 | $input v_color0,v_texcoord0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include "../common/common.sh"
9 |
10 | SAMPLER2D(texture_diffuse, 0);
11 | SAMPLER2D(texture_specular, 1);
12 | SAMPLER2D(texture_normal, 2);
13 | SAMPLER2D(texture_emissive, 3);
14 |
15 | void main()
16 | {
17 | vec4 color = toLinear(texture2D(texture_diffuse, v_texcoord0) );
18 | gl_FragColor = color;
19 | }
20 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/role/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
3 | vec3 a_position : POSITION;
4 |
5 | vec4 a_color0 : COLOR0;
6 | vec2 a_texcoord0 : TEXCOORD0;
7 |
8 |
9 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/role/vs_role.sc:
--------------------------------------------------------------------------------
1 | $input a_position,a_normal,a_texcoord0, a_color0
2 | $output v_color0,v_texcoord0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include "../common/common.sh"
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_color0 = a_color0;
15 | v_texcoord0 = a_texcoord0;
16 | }
17 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/sky/fs_hdr_skybox.sc:
--------------------------------------------------------------------------------
1 | $input v_texcoord0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include "../common/common.sh"
9 |
10 | SAMPLERCUBE(s_texCube, 0);
11 | uniform mat4 u_mtx;
12 |
13 | void main()
14 | {
15 | vec3 dir = vec3(v_texcoord0*2.0 - 1.0, 1.0);
16 | dir = normalize(mul(u_mtx, vec4(dir, 0.0) ).xyz);
17 | //gl_FragColor = encodeRGBE8(textureCube(s_texCube, dir).xyz);
18 | gl_FragColor = (textureCube(s_texCube, dir));
19 | }
20 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/sky/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
3 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
4 | vec4 v_texcoord1 : TEXCOORD1 = vec4(0.0, 0.0, 0.0, 0.0);
5 | vec4 v_texcoord2 : TEXCOORD2 = vec4(0.0, 0.0, 0.0, 0.0);
6 | vec4 v_texcoord3 : TEXCOORD3 = vec4(0.0, 0.0, 0.0, 0.0);
7 | vec4 v_texcoord4 : TEXCOORD4 = vec4(0.0, 0.0, 0.0, 0.0);
8 | vec3 v_pos : TEXCOORD5 = vec3(0.0, 0.0, 0.0);
9 | vec3 v_view : TEXCOORD6 = vec3(0.0, 0.0, 0.0);
10 |
11 | vec3 a_position : POSITION;
12 | vec4 a_color0 : COLOR0;
13 | vec2 a_texcoord0 : TEXCOORD0;
14 | vec3 a_normal : NORMAL;
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/source_shader/sky/vs_hdr_skybox.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_texcoord0
2 | $output v_texcoord0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include "../common/common.sh"
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_texcoord0 = a_texcoord0;
15 | }
16 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear0.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragColor = bgfx_clear_color[0];
13 | }
14 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear1.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | }
15 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear2.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | gl_FragData[2] = bgfx_clear_color[2];
15 | }
16 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear3.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | gl_FragData[2] = bgfx_clear_color[2];
15 | gl_FragData[3] = bgfx_clear_color[3];
16 | }
17 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear4.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | gl_FragData[2] = bgfx_clear_color[2];
15 | gl_FragData[3] = bgfx_clear_color[3];
16 | gl_FragData[4] = bgfx_clear_color[4];
17 | }
18 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear5.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | gl_FragData[2] = bgfx_clear_color[2];
15 | gl_FragData[3] = bgfx_clear_color[3];
16 | gl_FragData[4] = bgfx_clear_color[4];
17 | gl_FragData[5] = bgfx_clear_color[5];
18 | }
19 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear6.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | gl_FragData[2] = bgfx_clear_color[2];
15 | gl_FragData[3] = bgfx_clear_color[3];
16 | gl_FragData[4] = bgfx_clear_color[4];
17 | gl_FragData[5] = bgfx_clear_color[5];
18 | gl_FragData[6] = bgfx_clear_color[6];
19 | }
20 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_clear7.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "bgfx_shader.sh"
7 |
8 | uniform vec4 bgfx_clear_color[8];
9 |
10 | void main()
11 | {
12 | gl_FragData[0] = bgfx_clear_color[0];
13 | gl_FragData[1] = bgfx_clear_color[1];
14 | gl_FragData[2] = bgfx_clear_color[2];
15 | gl_FragData[3] = bgfx_clear_color[3];
16 | gl_FragData[4] = bgfx_clear_color[4];
17 | gl_FragData[5] = bgfx_clear_color[5];
18 | gl_FragData[6] = bgfx_clear_color[6];
19 | gl_FragData[7] = bgfx_clear_color[7];
20 | }
21 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/fs_debugfont.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_color1, v_texcoord0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include "bgfx_shader.sh"
9 |
10 | SAMPLER2D(s_texColor, 0);
11 |
12 | void main()
13 | {
14 | vec4 color = mix(v_color1, v_color0, texture2D(s_texColor, v_texcoord0).xxxx);
15 | if (color.w < 1.0/255.0)
16 | {
17 | discard;
18 | }
19 | gl_FragColor = color;
20 | }
21 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec4 v_color1 : COLOR1 = vec4(0.0, 1.0, 0.0, 1.0);
3 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
4 | vec3 v_normal : TEXCOORD1 = vec3(0.0, 1.0, 0.0);
5 |
6 | vec3 a_position : POSITION;
7 | vec3 a_normal : NORMAL0;
8 | vec4 a_color0 : COLOR0;
9 | vec4 a_color1 : COLOR1;
10 | vec2 a_texcoord0 : TEXCOORD0;
11 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/vs_clear.sc:
--------------------------------------------------------------------------------
1 | $input a_position
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include "bgfx_shader.sh"
9 |
10 | uniform vec4 bgfx_clear_depth;
11 |
12 | void main()
13 | {
14 | gl_Position = vec4(a_position.xy, bgfx_clear_depth.x, 1.0);
15 | }
16 |
--------------------------------------------------------------------------------
/runtime_visual_shader/src_shader/vs_debugfont.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0
2 | $output v_color0, v_color1, v_texcoord0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include "bgfx_shader.sh"
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_texcoord0 = a_texcoord0;
15 | v_color0 = a_color0;
16 | v_color1 = a_color1;
17 | }
18 |
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_albedo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_albedo.png
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_ao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_ao.png
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_height.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_height.png
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_normal.png
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_roughness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/TexturesCom_AeratedConcrete_Worn_1K_roughness.png
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/parallax-d.ktx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/parallax-d.ktx
--------------------------------------------------------------------------------
/runtime_visual_shader/textures/uffizi.ktx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zwluoqi/mobile-visual-shader-editor/e02e34e02a826f2f1cda74ca385a65e720883917/runtime_visual_shader/textures/uffizi.ktx
--------------------------------------------------------------------------------
/runtime_visual_shader/tvos-info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIRequiredDeviceCapabilities
26 |
27 | arm64
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/common/camera.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Dario Manesku. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #ifndef CAMERA_H_HEADER_GUARD
7 | #define CAMERA_H_HEADER_GUARD
8 |
9 | #include "entry/entry.h"
10 |
11 | #define CAMERA_KEY_FORWARD UINT8_C(0x01)
12 | #define CAMERA_KEY_BACKWARD UINT8_C(0x02)
13 | #define CAMERA_KEY_LEFT UINT8_C(0x04)
14 | #define CAMERA_KEY_RIGHT UINT8_C(0x08)
15 | #define CAMERA_KEY_UP UINT8_C(0x10)
16 | #define CAMERA_KEY_DOWN UINT8_C(0x20)
17 |
18 | ///
19 | void cameraCreate();
20 |
21 | ///
22 | void cameraDestroy();
23 |
24 | ///
25 | void cameraSetPosition(const bx::Vec3& _pos);
26 |
27 | ///
28 | void cameraSetHorizontalAngle(float _horizontalAngle);
29 |
30 | ///
31 | void cameraSetVerticalAngle(float _verticalAngle);
32 |
33 | ///
34 | void cameraSetKeyState(uint8_t _key, bool _down);
35 |
36 | ///
37 | void cameraGetViewMtx(float* _viewMtx);
38 |
39 | ///
40 | bx::Vec3 cameraGetPosition();
41 |
42 | ///
43 | bx::Vec3 cameraGetAt();
44 |
45 | ///
46 | void cameraUpdate(float _deltaTime, const entry::MouseState& _mouseState, bool _reset = false);
47 |
48 | #endif // CAMERA_H_HEADER_GUARD
49 |
--------------------------------------------------------------------------------
/src/common/common.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #ifndef COMMON_H_HEADER_GUARD
7 | #define COMMON_H_HEADER_GUARD
8 |
9 | #include
10 | #include
11 |
12 | #include "entry/entry.h"
13 |
14 | #endif // COMMON_H_HEADER_GUARD
15 |
--------------------------------------------------------------------------------
/src/common/common.sh:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include
7 | #include "shaderlib.sh"
8 |
--------------------------------------------------------------------------------
/src/common/debugdraw/fs_debugdraw_fill.sc:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include
7 |
8 | uniform vec4 u_params[4];
9 |
10 | #define u_lightDir u_params[0].xyz
11 | #define u_shininess u_params[0].w
12 | #define u_skyColor u_params[1].xyz
13 | #define u_groundColor u_params[2].xyz
14 | #define u_matColor u_params[3]
15 |
16 | void main()
17 | {
18 | gl_FragColor = u_matColor;
19 | }
20 |
--------------------------------------------------------------------------------
/src/common/debugdraw/fs_debugdraw_fill_lit.sc:
--------------------------------------------------------------------------------
1 | $input v_view, v_world
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | uniform vec4 u_params[4];
11 |
12 | #define u_lightDir u_params[0].xyz
13 | #define u_shininess u_params[0].w
14 | #define u_skyColor u_params[1].xyz
15 | #define u_groundColor u_params[2].xyz
16 | #define u_matColor u_params[3]
17 |
18 | void main()
19 | {
20 | vec3 normal = normalize(cross(dFdx(v_world), dFdy(v_world) ) );
21 | vec3 viewDir = -normalize(v_view);
22 |
23 | float ndotl = dot(normal, u_lightDir);
24 | vec3 diffuse = mix(u_groundColor, u_skyColor, ndotl*0.5 + 0.5) * u_matColor.xyz;
25 |
26 | #if 0
27 | vec3 reflected = 2.0*ndotl*normal - u_lightDir;
28 | float rdotv = dot(reflected, viewDir);
29 | float spec = step(0.0, ndotl) * pow(max(0.0, rdotv), u_shininess);
30 | #else
31 | float spec = 0.0;
32 | #endif
33 |
34 | gl_FragColor = vec4(diffuse + vec3_splat(spec), u_matColor.w);
35 | }
36 |
--------------------------------------------------------------------------------
/src/common/debugdraw/fs_debugdraw_fill_texture.sc:
--------------------------------------------------------------------------------
1 | $input v_texcoord0, v_color0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | SAMPLER2D(s_texColor, 0);
11 |
12 | void main()
13 | {
14 | gl_FragColor = texture2D(s_texColor, v_texcoord0) * v_color0;
15 | }
16 |
--------------------------------------------------------------------------------
/src/common/debugdraw/fs_debugdraw_lines.sc:
--------------------------------------------------------------------------------
1 | $input v_color0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | void main()
11 | {
12 | gl_FragColor = v_color0;
13 | }
14 |
--------------------------------------------------------------------------------
/src/common/debugdraw/fs_debugdraw_lines_stipple.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_stipple
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | void main()
11 | {
12 | if (0.125 < mod(v_stipple, 0.25) )
13 | {
14 | discard;
15 | }
16 |
17 | gl_FragColor = v_color0;
18 | }
19 |
--------------------------------------------------------------------------------
/src/common/debugdraw/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | #
5 |
6 | include ../../../scripts/shader-embeded.mk
7 |
8 | rebuild:
9 | @make -s --no-print-directory clean all
10 |
--------------------------------------------------------------------------------
/src/common/debugdraw/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec3 a_position : POSITION;
2 | uvec4 a_indices : BLENDINDICES;
3 | vec4 a_color0 : COLOR0;
4 | vec2 a_texcoord0 : TEXCOORD0;
5 |
6 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
7 | vec4 v_color0 : COLOR = vec4(1.0, 0.0, 0.0, 1.0);
8 | float v_stipple : TEXCOORD0 = 0.0;
9 | vec3 v_view : TEXCOORD0 = vec3(0.0, 0.0, 0.0);
10 | vec3 v_world : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
11 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_fill.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_indices
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | void main()
11 | {
12 | vec4 model = mul(u_model[int(a_indices.x)], vec4(a_position, 1.0) );
13 | gl_Position = mul(u_viewProj, model);
14 | }
15 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_fill_lit.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_indices
2 | $output v_view, v_world
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | vec4 world = mul(u_model[int(a_indices.x)], vec4(a_position, 1.0) );
14 | gl_Position = mul(u_viewProj, world);
15 | v_view = mul(u_view, world).xyz;
16 | v_world = world.xyz;
17 | }
18 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc:
--------------------------------------------------------------------------------
1 | $input a_position
2 | $output v_view, v_world
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | vec4 world = mul(u_model[0], vec4(a_position, 1.0) );
14 | gl_Position = mul(u_viewProj, world);
15 | v_view = mul(u_view, world).xyz;
16 | v_world = world.xyz;
17 | }
18 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_fill_mesh.sc:
--------------------------------------------------------------------------------
1 | $input a_position
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | void main()
11 | {
12 | vec4 model = mul(u_model[0], vec4(a_position, 1.0) );
13 | gl_Position = mul(u_viewProj, model);
14 | }
15 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_fill_texture.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_texcoord0, a_color0
2 | $output v_texcoord0, v_color0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_texcoord0 = a_texcoord0;
15 | v_color0 = a_color0;
16 | }
17 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_lines.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0
2 | $output v_color0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_color0 = a_color0;
15 | }
16 |
--------------------------------------------------------------------------------
/src/common/debugdraw/vs_debugdraw_lines_stipple.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_stipple
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_color0 = a_color0;
15 | v_stipple = a_texcoord0.x;
16 | }
17 |
--------------------------------------------------------------------------------
/src/common/entry/cmd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #ifndef CMD_H_HEADER_GUARD
7 | #define CMD_H_HEADER_GUARD
8 |
9 | struct CmdContext;
10 | typedef int (*ConsoleFn)(CmdContext* _context, void* _userData, int _argc, char const* const* _argv);
11 |
12 | ///
13 | void cmdInit();
14 |
15 | ///
16 | void cmdShutdown();
17 |
18 | ///
19 | void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData = NULL);
20 |
21 | ///
22 | void cmdExec(const char* _format, ...);
23 |
24 | #endif // CMD_H_HEADER_GUARD
25 |
--------------------------------------------------------------------------------
/src/common/entry/dbg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #ifndef DBG_H_HEADER_GUARD
7 | #define DBG_H_HEADER_GUARD
8 |
9 | #include
10 |
11 | #define DBG_STRINGIZE(_x) DBG_STRINGIZE_(_x)
12 | #define DBG_STRINGIZE_(_x) #_x
13 | #define DBG_FILE_LINE_LITERAL "" __FILE__ "(" DBG_STRINGIZE(__LINE__) "): "
14 | #define DBG(_format, ...) bx::debugPrintf(DBG_FILE_LINE_LITERAL "" _format "\n", ##__VA_ARGS__)
15 |
16 | #endif // DBG_H_HEADER_GUARD
17 |
--------------------------------------------------------------------------------
/src/common/entry/dialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #ifndef DIALOG_H_HEADER_GUARD
7 | #define DIALOG_H_HEADER_GUARD
8 |
9 | namespace bx { class FilePath; class StringView; }
10 |
11 | struct FileSelectionDialogType
12 | {
13 | enum Enum
14 | {
15 | Open,
16 | Save,
17 |
18 | Count
19 | };
20 | };
21 |
22 | ///
23 | bool openFileSelectionDialog(
24 | bx::FilePath& _inOutFilePath
25 | , FileSelectionDialogType::Enum _type
26 | , const bx::StringView& _title
27 | , const bx::StringView& _filter = "All Files | *"
28 | );
29 |
30 | ///
31 | void openUrl(const bx::StringView& _url);
32 |
33 | #endif // DIALOG_H_HEADER_GUARD
34 |
--------------------------------------------------------------------------------
/src/common/font/fs_font_basic.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | void main()
8 | {
9 | vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
10 | int index = int(v_texcoord0.w*4.0 + 0.5);
11 | float alpha = index < 1 ? color.z :
12 | index < 2 ? color.y :
13 | index < 3 ? color.x : color.w;
14 | gl_FragColor = vec4(v_color0.xyz, v_color0.a * alpha);
15 | }
16 |
--------------------------------------------------------------------------------
/src/common/font/fs_font_distance_field.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | uniform vec4 u_params;
8 |
9 | #define u_distanceMultiplier u_params.y
10 |
11 | void main()
12 | {
13 | vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
14 | int index = int(v_texcoord0.w*4.0 + 0.5);
15 | float rgba[4];
16 | rgba[0] = color.z;
17 | rgba[1] = color.y;
18 | rgba[2] = color.x;
19 | rgba[3] = color.w;
20 | float distance = rgba[index];
21 |
22 | float smoothing = 16.0 * length(fwidth(v_texcoord0.xyz)) / sqrt(2.0) * u_distanceMultiplier;
23 |
24 | float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
25 | vec4 sdfColor = vec4(v_color0.xyz, alpha * v_color0.w);
26 | gl_FragColor = sdfColor;
27 | }
28 |
--------------------------------------------------------------------------------
/src/common/font/fs_font_distance_field_outline.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_color1, v_texcoord0, v_texcoord1
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | uniform vec4 u_params;
8 |
9 | #define u_distanceMultiplier u_params.y
10 | #define u_outlineWidth u_params.w
11 |
12 | void main()
13 | {
14 | vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
15 |
16 | int index = int(v_texcoord0.w*4.0 + 0.5);
17 | float rgba[4];
18 | rgba[0] = color.z;
19 | rgba[1] = color.y;
20 | rgba[2] = color.x;
21 | rgba[3] = color.w;
22 | float distance = rgba[index];
23 |
24 | float smoothing = 16.0 * length(fwidth(v_texcoord0.xyz)) / sqrt(2.0) * u_distanceMultiplier;
25 |
26 | float outlineWidth = u_outlineWidth * smoothing;
27 | float outerEdgeCenter = 0.5 - outlineWidth;
28 | float alpha = smoothstep(outerEdgeCenter - smoothing, outerEdgeCenter + smoothing, distance);
29 | float border = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
30 | vec4 sdfColor = vec4( mix(v_color1.xyz, v_color0.xyz, border), alpha * v_color0.w );
31 | gl_FragColor = sdfColor;
32 | }
33 |
--------------------------------------------------------------------------------
/src/common/font/fs_font_distance_field_subpixel.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../../common/common.sh"
4 |
5 | SAMPLERCUBE(s_texColor, 0);
6 |
7 | void main()
8 | {
9 | int index = int(v_texcoord0.w*4.0 + 0.5);
10 | vec3 dx3 = dFdx(v_texcoord0.xyz);
11 | vec3 dy3 = dFdy(v_texcoord0.xyz);
12 | vec3 decal = 0.166667 * dx3;
13 | vec3 sampleLeft = v_texcoord0.xyz - decal;
14 | vec3 sampleRight = v_texcoord0.xyz + decal;
15 |
16 | float left_dist = textureCube(s_texColor, sampleLeft).zyxw[index];
17 | float right_dist = textureCube(s_texColor, sampleRight).zyxw[index];
18 |
19 | float dist = 0.5 * (left_dist + right_dist);
20 |
21 | float dx = length(dx3);
22 | float dy = length(dy3);
23 | float w = 16.0*0.5*(dx+dy);
24 |
25 | vec3 sub_color = smoothstep(0.5 - w, 0.5 + w, vec3(left_dist, dist, right_dist));
26 | gl_FragColor.xyz = sub_color*v_color0.w;
27 | gl_FragColor.w = dist*v_color0.w;
28 | }
29 |
--------------------------------------------------------------------------------
/src/common/font/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | #
5 |
6 | include ../../../scripts/shader-embeded.mk
7 |
8 | rebuild:
9 | @make -s --no-print-directory clean all
10 |
--------------------------------------------------------------------------------
/src/common/font/utf8.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008-2009 Bjoern Hoehrmann
2 | // See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
3 |
4 | #ifndef UTF8_H_HEADER_GUARD
5 | #define UTF8_H_HEADER_GUARD
6 |
7 | #include
8 |
9 | #define UTF8_ACCEPT 0
10 | #define UTF8_REJECT 1
11 |
12 | uint32_t utf8_decode(uint32_t* _state, uint32_t* _codep, uint8_t _ch);
13 |
14 | #endif // UTF8_H_HEADER_GUARD
15 |
--------------------------------------------------------------------------------
/src/common/font/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec2 a_position : POSITION;
2 | vec4 a_color0 : COLOR0;
3 | vec4 a_color1 : COLOR1;
4 | vec4 a_texcoord0 : TEXCOORD0;
5 | vec4 a_texcoord1 : TEXCOORD1;
6 | vec4 a_texcoord2 : TEXCOORD2;
7 |
8 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
9 | vec4 v_color1 : COLOR1 = vec4(1.0, 0.0, 0.0, 1.0);
10 | vec4 v_texcoord0 : TEXCOORD0 = vec4(0.0, 0.0, 0.0, 0.0);
11 | vec4 v_texcoord1 : TEXCOORD1 = vec4(0.0, 0.0, 0.0, 0.0);
12 | vec4 v_texcoord2 : TEXCOORD2 = vec4(0.0, 0.0, 0.0, 0.0);
13 | vec4 v_sampleLeft : TEXCOORD1 = vec4(0.0, 0.0, 0.0, 0.0);
14 | vec4 v_sampleRight : TEXCOORD2 = vec4(0.0, 0.0, 0.0, 0.0);
15 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_basic.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_color0 = a_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_color0 = a_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field_drop_shadow.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1, a_texcoord2
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1, v_texcoord2
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_texcoord2 = a_texcoord2;
12 | v_color0 = a_color0;
13 | v_color1 = a_color1;
14 | }
15 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field_drop_shadow_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1, a_texcoord2
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1, v_texcoord2
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_texcoord2 = a_texcoord2;
12 | v_color0 = a_color0;
13 | v_color1 = a_color1;
14 | }
15 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field_outline.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_color0 = a_color0;
12 | v_color1 = a_color1;
13 | }
14 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field_outline_drop_shadow_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1, a_texcoord2
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1, v_texcoord2
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_texcoord2 = a_texcoord2;
12 | v_color0 = a_color0;
13 | v_color1 = a_color1;
14 | }
15 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field_outline_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_color1, a_texcoord0, a_texcoord1
2 | $output v_color0, v_color1, v_texcoord0, v_texcoord1
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_texcoord1 = a_texcoord1;
11 | v_color0 = a_color0;
12 | v_color1 = a_color1;
13 | }
14 |
--------------------------------------------------------------------------------
/src/common/font/vs_font_distance_field_subpixel.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../../common/common.sh"
5 |
6 | void main()
7 | {
8 | gl_Position = mul(u_modelViewProj, vec4(a_position, 0.0, 1.0) );
9 | v_texcoord0 = a_texcoord0;
10 | v_color0 = a_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/src/common/imgui/fs_imgui_image.sc:
--------------------------------------------------------------------------------
1 | $input v_texcoord0
2 |
3 | /*
4 | * Copyright 2014 Dario Manesku. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | uniform vec4 u_imageLodEnabled;
11 | SAMPLER2D(s_texColor, 0);
12 |
13 | #define u_imageLod u_imageLodEnabled.x
14 | #define u_imageEnabled u_imageLodEnabled.y
15 |
16 | void main()
17 | {
18 | vec3 color = texture2DLod(s_texColor, v_texcoord0, u_imageLod).xyz;
19 | float alpha = 0.2 + 0.8*u_imageEnabled;
20 | gl_FragColor = vec4(color, alpha);
21 | }
22 |
--------------------------------------------------------------------------------
/src/common/imgui/fs_ocornut_imgui.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | #include "../common.sh"
4 |
5 | SAMPLER2D(s_tex, 0);
6 |
7 | void main()
8 | {
9 | vec4 texel = texture2D(s_tex, v_texcoord0);
10 | gl_FragColor = texel * v_color0;
11 | }
12 |
--------------------------------------------------------------------------------
/src/common/imgui/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | #
5 |
6 | include ../../../scripts/shader-embeded.mk
7 |
8 | droidsans.ttf.h: ../../runtime/font/droidsans.ttf
9 | @bin2c -f $(<) -o $(@) -n s_droidSansTtf
10 |
11 | roboto_regular.ttf.h: ../../runtime/font/roboto-regular.ttf
12 | @bin2c -f $(<) -o $(@) -n s_robotoRegularTtf
13 |
14 | robotomono_regular.ttf.h: ../../runtime/font/robotomono-regular.ttf
15 | @bin2c -f $(<) -o $(@) -n s_robotoMonoRegularTtf
16 |
17 | icons_font_awesome.ttf.h: ../../runtime/font/fontawesome-webfont.ttf
18 | @bin2c -f $(<) -o $(@) -n s_iconsFontAwesomeTtf
19 |
20 | icons_kenney.ttf.h: ../../runtime/font/kenney-icon-font.ttf
21 | @bin2c -f $(<) -o $(@) -n s_iconsKenneyTtf
22 |
23 | fonts: droidsans.ttf.h \
24 | roboto_regular.ttf.h \
25 | robotomono_regular.ttf.h \
26 | icons_font_awesome.ttf.h \
27 | icons_kenney.ttf.h
28 |
29 | rebuild: fonts
30 | @make -s --no-print-directory clean all
31 |
--------------------------------------------------------------------------------
/src/common/imgui/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
3 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
4 |
5 | vec2 a_position : POSITION;
6 | vec4 a_normal : NORMAL;
7 | vec4 a_color0 : COLOR0;
8 | vec2 a_texcoord0 : TEXCOORD0;
9 |
--------------------------------------------------------------------------------
/src/common/imgui/vs_imgui_image.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_texcoord0
2 | $output v_texcoord0
3 |
4 | /*
5 | * Copyright 2014 Dario Manesku. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0) );
14 | v_texcoord0 = a_texcoord0;
15 | }
16 |
--------------------------------------------------------------------------------
/src/common/imgui/vs_ocornut_imgui.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_texcoord0, a_color0
2 | $output v_color0, v_texcoord0
3 |
4 | #include "../common.sh"
5 |
6 | void main()
7 | {
8 | vec4 pos = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0) );
9 | gl_Position = vec4(pos.x, pos.y, 0.0, 1.0);
10 | v_texcoord0 = a_texcoord0;
11 | v_color0 = a_color0;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/src/common/nanovg/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | #
5 |
6 | include ../../../scripts/shader-embeded.mk
7 |
8 | rebuild:
9 | @make -s --no-print-directory clean all
10 |
--------------------------------------------------------------------------------
/src/common/nanovg/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec2 v_position : TEXCOORD0 = vec2(0.0, 0.0);
2 | vec2 v_texcoord0 : TEXCOORD1 = vec2(0.0, 0.0);
3 |
4 | vec2 a_position : POSITION;
5 | vec2 a_texcoord0 : TEXCOORD0;
6 |
--------------------------------------------------------------------------------
/src/common/nanovg/vs_nanovg_fill.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_texcoord0
2 | $output v_position, v_texcoord0
3 |
4 | #include "../common.sh"
5 |
6 | #define NEED_HALF_TEXEL (BGFX_SHADER_LANGUAGE_HLSL < 400)
7 |
8 | uniform vec4 u_viewSize;
9 |
10 | #if NEED_HALF_TEXEL
11 | uniform vec4 u_halfTexel;
12 | #endif // NEED_HALF_TEXEL
13 |
14 | void main()
15 | {
16 | #if !NEED_HALF_TEXEL
17 | const vec4 u_halfTexel = vec4_splat(0.0);
18 | #endif // !NEED_HALF_TEXEL
19 |
20 | v_position = a_position;
21 | v_texcoord0 = a_texcoord0+u_halfTexel.xy;
22 | gl_Position = vec4(2.0*v_position.x/u_viewSize.x - 1.0, 1.0 - 2.0*v_position.y/u_viewSize.y, 0.0, 1.0);
23 | }
24 |
--------------------------------------------------------------------------------
/src/common/ps/fs_particle.sc:
--------------------------------------------------------------------------------
1 | $input v_color0, v_texcoord0
2 |
3 | /*
4 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
5 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
6 | */
7 |
8 | #include
9 |
10 | SAMPLER2D(s_texColor, 0);
11 |
12 | void main()
13 | {
14 | vec4 rgba = texture2D(s_texColor, v_texcoord0.xy).xxxx;
15 |
16 | rgba.xyz = rgba.xyz * v_color0.xyz * rgba.w * v_color0.w;
17 | rgba.w = rgba.w * v_color0.w * (1.0f - v_texcoord0.z);
18 | gl_FragColor = rgba;
19 | }
20 |
--------------------------------------------------------------------------------
/src/common/ps/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | #
5 |
6 | include ../../../scripts/shader-embeded.mk
7 |
8 | rebuild:
9 | @make -s --no-print-directory clean all
10 |
--------------------------------------------------------------------------------
/src/common/ps/varying.def.sc:
--------------------------------------------------------------------------------
1 | vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
2 | vec4 v_texcoord0 : TEXCOORD0 = vec4(0.0, 0.0, 0.0, 0.0);
3 |
4 | vec3 a_position : POSITION;
5 | vec4 a_color0 : COLOR0;
6 | vec4 a_texcoord0 : TEXCOORD0;
7 |
--------------------------------------------------------------------------------
/src/common/ps/vs_particle.sc:
--------------------------------------------------------------------------------
1 | $input a_position, a_color0, a_texcoord0
2 | $output v_color0, v_texcoord0
3 |
4 | /*
5 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
6 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
7 | */
8 |
9 | #include
10 |
11 | void main()
12 | {
13 | gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14 | v_color0 = a_color0;
15 | v_texcoord0 = a_texcoord0;
16 | }
17 |
--------------------------------------------------------------------------------
/src/runtime/osx-info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHighResolutionCapable
28 | True
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/runtime/tvos-info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIRequiredDeviceCapabilities
26 |
27 | arm64
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_core/config.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Contains configuration parameters to tune exactly how the shader editor works.
6 | */
7 |
8 | #include
9 |
10 | constexpr size_t INTERFACE_EVENT_ARRAY_SIZE{ 8 };
11 |
12 | constexpr int SERIALIZED_GRAPH_PRECISION{ 4 };
13 |
14 | constexpr float FLOAT_COMPARE_DIFF{ 5e-5f };
15 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_core/lerp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace csc {
4 |
5 | template T lerp(const T& a, const T& b, const float t)
6 | {
7 | return a + (b - a) * t;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_core/rect.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines FloatRect.
6 | */
7 |
8 | #include "vector.h"
9 |
10 | namespace csc {
11 |
12 | /**
13 | * @brief Used to represent some rectangle in 2d space.
14 | */
15 | class FloatRect {
16 | public:
17 | FloatRect(Float2 p1, Float2 p2);
18 |
19 | inline Float2 begin() const { return _begin; }
20 | inline Float2 end() const { return _begin + _size; }
21 | inline Float2 size() const { return _size; }
22 |
23 | inline float area() const { return _size.x * _size.y; }
24 | inline Float2 center() const { return _begin + _size / 2.0f; }
25 |
26 | Float2 clamp(Float2 point) const;
27 | // Map from [min, max] to [0, 1]
28 | Float2 normalized_pos(Float2 point) const;
29 | // Map from [0, 1] to [min, max]
30 | Float2 scaled_pos(Float2 point) const;
31 |
32 | FloatRect grow(float amount) const;
33 | FloatRect with_point(Float2 point) const;
34 |
35 | bool contains(Float2 point) const;
36 | bool overlaps(FloatRect other) const;
37 |
38 | private:
39 | Float2 _begin;
40 | Float2 _size;
41 | };
42 | }
43 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/alt_slot_names.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "../shader_graph/node.h"
6 |
7 | namespace cse {
8 | boost::string_view get_alt_slot_name(const csg::Node& node, const boost::string_view& disp_name);
9 | }
10 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/glfw_callbacks.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines functions that allow a MainWindow to be hooked up with glfw callbacks.
6 | */
7 |
8 | //struct GLFWwindow;
9 | //#include "entry/entry.h"
10 |
11 | namespace cse {
12 |
13 | class MainWindow;
14 |
15 | void register_window_pair_for_callbacks(MainWindow* main_window);
16 | void iteration_window_pair_for_callbacks();
17 | }
18 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/modal_ramp_color_pick.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | #include "event.h"
9 |
10 | namespace cse {
11 | class ModalRampColorPicker {
12 | public:
13 |
14 | void attach(csg::SlotId slot_id, size_t index, csc::Float4 rgba);
15 |
16 | InterfaceEventArray run() const;
17 |
18 | void do_event(const InterfaceEvent& event);
19 |
20 | private:
21 | struct ColorLocation {
22 | ColorLocation(csg::SlotId slot_id, size_t index) : slot_id{ slot_id }, index{ index } {}
23 |
24 | csg::SlotId slot_id;
25 | size_t index;
26 | };
27 | std::array rgba;
28 | boost::optional attached_location;
29 | };
30 | }
31 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/platform.cpp:
--------------------------------------------------------------------------------
1 | #include "platform.h"
2 | #include "../common/entry/input.h"
3 |
4 | bool cse::Platform::save_graph_dialog()
5 | {
6 | char tmp[bx::kMaxFilePath];
7 | entry::postDialogSaveEventToMainThread(tmp);
8 | return true;
9 | }
10 |
11 | void cse::Platform::load_graph_dialog()
12 | {
13 | char tmp[bx::kMaxFilePath];
14 | tmp[0]='n';
15 | entry::postDialogOpenEventToMainThread(tmp);
16 | }
17 |
18 | void cse::Platform::open_image_dialog(){
19 | char tmp[bx::kMaxFilePath];
20 | tmp[0]='i';
21 | entry::postDialogOpenEventToMainThread(tmp);
22 | }
23 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/platform.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines an abstraction over all platform-specific functionality.
6 | */
7 |
8 | #include
9 |
10 | #include
11 |
12 | namespace cse {
13 | namespace Platform {
14 | bool save_graph_dialog();
15 | void load_graph_dialog();
16 | void open_image_dialog();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/selection.cpp:
--------------------------------------------------------------------------------
1 | #include "selection.h"
2 |
3 | void cse::NodeSelection::select(const SelectMode mode, const csg::NodeId id)
4 | {
5 | switch (mode) {
6 | case SelectMode::EXCLUSIVE:
7 | if (_selected.count(id) == 0) {
8 | // Ignore exclusive selects when the new node is already selected
9 | // This allows click+drag to work without resetting the selection
10 | _selected.clear();
11 | _selected.insert(id);
12 | }
13 | break;
14 | case SelectMode::ADD:
15 | _selected.insert(id);
16 | break;
17 | case SelectMode::REMOVE:
18 | _selected.erase(id);
19 | break;
20 | case SelectMode::TOGGLE:
21 | if (_selected.count(id) > 0) {
22 | _selected.erase(id);
23 | }
24 | else {
25 | _selected.insert(id);
26 | }
27 | break;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/selection.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines NodeSelection.
6 | */
7 |
8 | #include
9 | #include
10 |
11 | #include "../shader_graph/node_id.h"
12 |
13 | #include "enum.h"
14 |
15 | namespace cse {
16 |
17 | /**
18 | * @brief Class used to track and manage the set of nodes a user has selected.
19 | */
20 | class NodeSelection {
21 | public:
22 | NodeSelection() {}
23 |
24 | void select(SelectMode mode, csg::NodeId id);
25 | void clear() { _selected.clear(); }
26 |
27 | size_t count() const { return _selected.size(); }
28 | bool is_selected(csg::NodeId id) const { return static_cast(_selected.count(id)); }
29 |
30 | const std::set& selected() const { return _selected; }
31 |
32 | private:
33 | std::set _selected;
34 | };
35 | }
36 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/subwindow_alert.cpp:
--------------------------------------------------------------------------------
1 | #include "subwindow_alert.h"
2 |
3 | #include
4 | #include "imgui/imgui.h"
5 |
6 | #include "enum.h"
7 |
8 | void cse::AlertSubwindow::set_message(const std::string& message_in)
9 | {
10 | this->message = message_in;
11 | }
12 |
13 | cse::InterfaceEventArray cse::AlertSubwindow::run() const
14 | {
15 | InterfaceEventArray events;
16 |
17 | events.push(InterfaceEvent{ InterfaceEventType::SUBWINDOW_IS_HOVERED, SubwindowIdDetails{ SubwindowId::ALERT }, boost::none });
18 |
19 | if (ImGui::Begin("Alert", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
20 | ImGui::Text("%s", message.c_str());
21 | ImGui::Separator();
22 | if (ImGui::Button("Close")) {
23 | events.push(InterfaceEvent{ InterfaceEventType::MODAL_ALERT_CLOSE });
24 | }
25 | }
26 | ImGui::End();
27 |
28 | return events;
29 | }
30 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/subwindow_alert.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "event.h"
6 |
7 | namespace cse {
8 | class AlertSubwindow {
9 | public:
10 | void set_message(const std::string& message);
11 |
12 | InterfaceEventArray run() const;
13 |
14 | private:
15 | std::string message{ "[No message]" };
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/subwindow_debug.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines DebugSubwindow.
6 | */
7 |
8 | #include
9 |
10 | #include "event.h"
11 |
12 | namespace cse {
13 | class DebugSubwindow {
14 | public:
15 | DebugSubwindow();
16 |
17 | InterfaceEventArray run() const;
18 |
19 | void do_event(const InterfaceEvent& event);
20 |
21 | private:
22 | std::string run_validation() const;
23 |
24 | std::string message;
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/subwindow_node_list.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines NodeListSubwindow.
6 | */
7 |
8 | #include
9 |
10 | #include "../shader_graph/node_type.h"
11 |
12 | #include "event.h"
13 |
14 | namespace cse {
15 | class NodeListSubwindow {
16 | public:
17 | NodeListSubwindow();
18 |
19 | InterfaceEventArray run() const;
20 |
21 | void do_event(const InterfaceEvent& event);
22 |
23 | boost::optional selected_type() const;
24 |
25 | private:
26 | //csg::NodeCategory selected_category{ csg::NodeCategory::SHADER };
27 | boost::optional _selected_type;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/subwindow_shader_text.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines DebugSubwindow.
6 | */
7 |
8 | #include
9 |
10 | #include "event.h"
11 |
12 | namespace cse {
13 | class ShaderTextSubwindow {
14 | public:
15 | ShaderTextSubwindow();
16 |
17 | InterfaceEventArray run() const;
18 |
19 | void do_event(const InterfaceEvent& event);
20 |
21 | private:
22 | std::string run_validation() const;
23 |
24 | std::string message;
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/undo.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "../shader_graph/graph.h"
6 |
7 | namespace cse {
8 | class UndoStack {
9 | public:
10 | UndoStack(const csg::Graph& graph);
11 |
12 | void clear(const csg::Graph& graph);
13 |
14 | bool push_undo(const csg::Graph& graph);
15 |
16 | csg::Graph pop_undo(const csg::Graph& for_redo);
17 | csg::Graph pop_redo(const csg::Graph& for_undo);
18 |
19 | bool undo_available() const { return undo_state.size() > 0; }
20 | bool redo_available() const { return redo_state.size() > 0; }
21 |
22 | private:
23 | csg::Graph next_undo_graph;
24 |
25 | std::list undo_state;
26 | std::list redo_state;
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/wrapper_glfw_func.cpp:
--------------------------------------------------------------------------------
1 | //#include "wrapper_glfw_func.h"
2 | //
3 | //// All functions are defined inline in the header
4 | //// All that is needed here is the global glfw mutex
5 | //
6 | //std::mutex glfw_global_mutex;
7 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/wrapper_glfw_func.h:
--------------------------------------------------------------------------------
1 | //#pragma once
2 | //
3 | //#include
4 | //#include
5 | //
6 | ////#include
7 | //
8 | //#include "wrapper_glfw_window.h"
9 | //
10 | //extern std::mutex glfw_global_mutex;
11 | //
12 | //inline void glfwPollEventsSafe(const std::unique_ptr& window)
13 | //{
14 | // std::lock_guard lock{ glfw_global_mutex };
15 | // glfwMakeContextCurrent(window->window_ptr);
16 | // glfwPollEvents();
17 | //}
18 | //
19 | //inline void glfwGetFramebufferSize(const std::unique_ptr& window, int& width, int& height)
20 | //{
21 | // glfwGetFramebufferSize(window->window_ptr, &width, &height);
22 | //}
23 | //
24 | //inline void glfwMakeContextCurrent(const std::unique_ptr& window)
25 | //{
26 | // glfwMakeContextCurrent(window->window_ptr);
27 | //}
28 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/wrapper_glfw_window.cpp:
--------------------------------------------------------------------------------
1 | //#include "wrapper_glfw_window.h"
2 | //
3 | ////#include
4 | //
5 | //cse::GlfwWindow::GlfwWindow(const int width, const int height, const char* const title) :
6 | // window_ptr{ glfwCreateWindow(width, height, title, nullptr, nullptr) }
7 | //{
8 | //
9 | //}
10 | //
11 | //cse::GlfwWindow::~GlfwWindow()
12 | //{
13 | // if (window_ptr) {
14 | // glfwDestroyWindow(window_ptr);
15 | // }
16 | //}
17 | //
18 | //bool cse::GlfwWindow::valid() const
19 | //{
20 | // return window_ptr != nullptr;
21 | //}
22 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_editor/wrapper_glfw_window.h:
--------------------------------------------------------------------------------
1 | //#pragma once
2 | //
3 | //struct GLFWwindow;
4 | //
5 | //namespace cse {
6 | //
7 | // // Class to safely wrap glfwCreateWindow and glfwDestroyWindow
8 | // class GlfwWindow {
9 | // public:
10 | // GlfwWindow(int width, int height, const char* title);
11 | // GlfwWindow(const GlfwWindow&) = delete;
12 | // ~GlfwWindow();
13 | //
14 | // bool valid() const;
15 | //
16 | // GLFWwindow* const window_ptr;
17 | // };
18 | //}
19 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_graph/node_id.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines NodeId.
6 | */
7 |
8 | #include
9 |
10 | namespace csg {
11 | typedef int64_t NodeId;
12 | }
13 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_graph/ramp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include "../shader_core/vector.h"
8 |
9 | namespace csg {
10 | struct ColorRampPoint {
11 | public:
12 | ColorRampPoint(float pos, csc::Float3 color, float alpha) : pos{ pos }, color{ color }, alpha{ alpha } {}
13 |
14 | float pos;
15 | csc::Float3 color;
16 | float alpha;
17 | };
18 |
19 | class ColorRamp {
20 | public:
21 | ColorRamp();
22 | ColorRamp(const std::vector& points);
23 |
24 | csc::Float4 eval(float pos) const;
25 |
26 | size_t size() const { return points.size(); }
27 |
28 | ColorRampPoint get(size_t index) const {
29 | assert(index < points.size());
30 | return points[index];
31 | }
32 | std::vector get() const { return points; }
33 |
34 | void set(size_t index, ColorRampPoint new_point);
35 | void remove(size_t index);
36 |
37 | bool similar(const ColorRamp& other, float margin) const;
38 |
39 | private:
40 | void sort_points();
41 |
42 | std::vector points;
43 | };
44 | }
45 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_graph/serialize.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include
6 |
7 | namespace csg {
8 | class Graph;
9 |
10 | std::string serialize_graph(const Graph& graph);
11 |
12 | boost::optional deserialize_graph(const std::string& graph_string);
13 | }
14 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_graph/slot_id.cpp:
--------------------------------------------------------------------------------
1 | #include "slot_id.h"
2 | #include
3 | #include
4 |
5 |
6 | bool csg::SlotId::operator==(const SlotId& other) const
7 | {
8 | return _node_id == other._node_id && _index == other._index;
9 | }
10 |
11 | bool csg::SlotId::operator<(const SlotId& other) const
12 | {
13 | if (_node_id < other._node_id) return true;
14 | if (other._node_id < _node_id) return false;
15 |
16 | if (_index < other._index) return true;
17 | if (other._index < _index) return false;
18 |
19 | return false;
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shader_online/shader_graph/slot_id.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | /**
4 | * @file
5 | * @brief Defines SlotId.
6 | */
7 |
8 | #include
9 |
10 | #include "node_id.h"
11 |
12 | namespace csg {
13 |
14 | /**
15 | * @brief Class used to address a single slot, either input or output.
16 | */
17 | class SlotId {
18 | public:
19 | SlotId(NodeId node_id, size_t index) : _node_id{ node_id }, _index{ index } {
20 |
21 | }
22 |
23 | NodeId node_id() const { return _node_id; }
24 | uint64_t slot_id() const { return _index + (0XFFFFFFFF00000000 &_node_id); }
25 | size_t index() const { return _index; }
26 |
27 | bool operator==(const SlotId& other) const;
28 | bool operator!=(const SlotId& other) const { return operator==(other) == false; }
29 |
30 | bool operator<(const SlotId& other) const;
31 |
32 | private:
33 |
34 |
35 |
36 | NodeId _node_id;
37 | size_t _index;
38 |
39 | };
40 | }
41 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/shaderc/shaderc_pssl.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
3 | * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4 | */
5 |
6 | #include "shaderc.h"
7 |
8 | namespace runshaderc
9 | {
10 | bool compilePSSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer)
11 | {
12 | BX_UNUSED(_options, _version, _code, _writer);
13 | bx::printf("PSSL compiler is not supported.\n");
14 | return false;
15 | }
16 |
17 | const char* getPsslPreamble()
18 | {
19 | return "";
20 | }
21 |
22 | } // namespace bgfx
23 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/user_engine/MeshFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #pragma once
7 |
8 | #include "Object.h"
9 | #include "Mesh.h"
10 |
11 | namespace userengine {
12 | class MeshFilter : public Object
13 | {
14 | public:
15 | MeshFilter(std::shared_ptr _mesh,Material _material):userengine::Object(_material),mesh(_mesh){
16 |
17 | }
18 |
19 | void destroy() const override ;
20 |
21 | bool draw_call(bgfx::ViewId _id, bgfx::ProgramHandle m_program,uint64_t _state = BGFX_STATE_MASK) const override;
22 |
23 | private:
24 | std::shared_ptr mesh;
25 | float modelMatrixs[32];//model_matrix,inv_model_matrix
26 | };
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/vistual-shader-graph/user_engine/MeshUtil.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2021 Zhouwei. All rights reserved.
3 | * License: https://github.com/zwluoqi/mobile-visual-shader-editor#license-bsd-2-clause
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 | #include
10 | #include