|
2904 | 2904 | <output name="out" type="vector3" nodename="N_normalmap" /> |
2905 | 2905 | </nodegraph> |
2906 | 2906 |
|
| 2907 | + <!-- |
| 2908 | + Node: <orthonormal_basis> |
| 2909 | + --> |
| 2910 | + <nodegraph name="NG_orthonormal_basis_1_0_vector3_vector3" nodedef="ND_orthonormal_basis_1_0_vector3_vector3" doc="Compute perpendicular basis vectors from a primary direction and normal"> |
| 2911 | + <normalize name="norm_primary" type="vector3"> |
| 2912 | + <input name="in" type="vector3" interfacename="primary_dir" /> |
| 2913 | + </normalize> |
| 2914 | + <normalize name="norm_normal" type="vector3"> |
| 2915 | + <input name="in" type="vector3" interfacename="normal_dir" /> |
| 2916 | + </normalize> |
| 2917 | + <dotproduct name="dot_primary_normal" type="float"> |
| 2918 | + <input name="in1" type="vector3" nodename="norm_primary" /> |
| 2919 | + <input name="in2" type="vector3" nodename="norm_normal" /> |
| 2920 | + </dotproduct> |
| 2921 | + <multiply name="parallel_component" type="vector3"> |
| 2922 | + <input name="in1" type="vector3" nodename="norm_normal" /> |
| 2923 | + <input name="in2" type="float" nodename="dot_primary_normal" /> |
| 2924 | + </multiply> |
| 2925 | + <subtract name="ortho_u" type="vector3"> |
| 2926 | + <input name="in1" type="vector3" nodename="norm_primary" /> |
| 2927 | + <input name="in2" type="vector3" nodename="parallel_component" /> |
| 2928 | + </subtract> |
| 2929 | + <normalize name="final_u" type="vector3"> |
| 2930 | + <input name="in" type="vector3" nodename="ortho_u" /> |
| 2931 | + </normalize> |
| 2932 | + <crossproduct name="final_v" type="vector3"> |
| 2933 | + <input name="in1" type="vector3" nodename="norm_normal" /> |
| 2934 | + <input name="in2" type="vector3" nodename="final_u" /> |
| 2935 | + </crossproduct> |
| 2936 | + <output name="out_u_axis" type="vector3" nodename="final_u" /> |
| 2937 | + <output name="out_v_axis" type="vector3" nodename="final_v" /> |
| 2938 | + </nodegraph> |
| 2939 | + |
| 2940 | + <!-- |
| 2941 | + Node: <project_to_plane> |
| 2942 | + --> |
| 2943 | + <nodegraph name="NG_project_to_plane_1_0_vector3" nodedef="ND_project_to_plane_1_0_vector3" doc="Project 3D point onto an infinite 3D plane"> |
| 2944 | + <subtract name="relative_pos" type="vector3"> |
| 2945 | + <input name="in1" type="vector3" interfacename="point" /> |
| 2946 | + <input name="in2" type="vector3" interfacename="plane_origin" /> |
| 2947 | + </subtract> |
| 2948 | + <dotproduct name="signed_dist" type="float"> |
| 2949 | + <input name="in1" type="vector3" nodename="relative_pos" /> |
| 2950 | + <input name="in2" type="vector3" interfacename="plane_normal" /> |
| 2951 | + </dotproduct> |
| 2952 | + <multiply name="offset_vec" type="vector3"> |
| 2953 | + <input name="in1" type="vector3" interfacename="plane_normal" /> |
| 2954 | + <input name="in2" type="float" nodename="signed_dist" /> |
| 2955 | + </multiply> |
| 2956 | + <subtract name="projected_pos" type="vector3"> |
| 2957 | + <input name="in1" type="vector3" nodename="relative_pos" /> |
| 2958 | + <input name="in2" type="vector3" nodename="offset_vec" /> |
| 2959 | + </subtract> |
| 2960 | + <output name="out" type="vector3" nodename="projected_pos" /> |
| 2961 | + </nodegraph> |
| 2962 | + |
| 2963 | + <!-- |
| 2964 | + Node: <planar_projection> |
| 2965 | + --> |
| 2966 | + <nodegraph name="NG_planar_projection_1_0_vector2" nodedef="ND_planar_projection_1_0_vector2" doc="Compute texture coordinates of a projection of a 3d point to a plane"> |
| 2967 | + <!-- Project position to plane --> |
| 2968 | + <project_to_plane name="point_proj" type="vector3"> |
| 2969 | + <input name="point" type="vector3" interfacename="point" /> |
| 2970 | + <input name="plane_origin" type="vector3" interfacename="plane_origin" /> |
| 2971 | + <input name="plane_normal" type="vector3" interfacename="plane_normal" /> |
| 2972 | + </project_to_plane> |
| 2973 | + <!-- Generate orthonormal basis --> |
| 2974 | + <orthonormal_basis name="basis_gen" type="multioutput"> |
| 2975 | + <input name="primary_dir" type="vector3" interfacename="u_vector" /> |
| 2976 | + <input name="normal_dir" type="vector3" interfacename="plane_normal" /> |
| 2977 | + <output name="out_u_axis" type="vector3" /> |
| 2978 | + <output name="out_v_axis" type="vector3" /> |
| 2979 | + </orthonormal_basis> |
| 2980 | + <!-- Calculate UV coordinates --> |
| 2981 | + <dotproduct name="u_coord" type="float"> |
| 2982 | + <input name="in1" type="vector3" nodename="point_proj" /> |
| 2983 | + <input name="in2" type="vector3" nodename="basis_gen" output="out_u_axis" /> |
| 2984 | + </dotproduct> |
| 2985 | + <dotproduct name="v_coord" type="float"> |
| 2986 | + <input name="in1" type="vector3" nodename="point_proj" /> |
| 2987 | + <input name="in2" type="vector3" nodename="basis_gen" output="out_v_axis" /> |
| 2988 | + </dotproduct> |
| 2989 | + <combine2 name="combined_uv" type="vector2"> |
| 2990 | + <input name="in1" type="float" nodename="u_coord" /> |
| 2991 | + <input name="in2" type="float" nodename="v_coord" /> |
| 2992 | + </combine2> |
| 2993 | + <output name="out" type="vector2" nodename="combined_uv" /> |
| 2994 | + </nodegraph> |
| 2995 | + |
2907 | 2996 | <!-- ======================================================================== --> |
2908 | 2997 | <!-- Global nodes --> |
2909 | 2998 | <!-- ======================================================================== --> |
|
0 commit comments