How to set Cg shader profile used when shader is being compiled? I’ve tried search - in one posts it is written that to set profile there is need to put these strings in the beginning of shader file -
//Cg profile vs_2_x fs_2_x
But in other threads it is written that it does not work and there is need to write so -
Traceback (most recent call last):
File "panda_3d.py", line 46, in <module>
BumpMappingShaderTerrain = Shader.load ( "Resources\Shaders\\bumpMapper_Terrain.sha", "vs_2_x", "ps_2_x" )
TypeError: an integer is required
The second question - I’ve specified normal map in egg file -
<Texture> tref1 {
Resources\Models\Terrain\layingrock_2.dds
<Scalar> minfilter { linear_mipmap_linear }
<Scalar> magfilter { linear }
}
<Texture> tref2 {
Resources\Models\Terrain\layingrock_2_nh.dds
<Scalar> format { rgba }
<Scalar> minfilter { linear_mipmap_linear }
<Scalar> magfilter { linear }
<Scalar> envtype { normal }
}
how now access it in the shader?
And another one question - if I create mip maps in, for example, AMD Compressonator and save them in dds file - will Panda use them or it will recreate its own mip maps?
As for the first question, the way to do it is via the shader. The special Shader.load syntax where you can specify a profile no longer exists.
Note that you also need to place “basics-shaders-only #f” in Config.prc.
Also when I’m trying to access tangents or binormals in shaders Panda simply freezes - stops responding on mouse and keyboard. It writes -
:display:gsg:dxgsg9(error): could not find matching vertex element data for vertex shader
:display:gsg:dxgsg9(error): unable to find a mapping for vertex shader input type=9 from vertex elements
:display:gsg:dxgsg9(error): could not find matching vertex element data for vertex shader
:display:gsg:dxgsg9(error): could not find matching vertex element data for vertex shader
:display:gsg:dxgsg9(error): could not find matching vertex element data for vertex shader
:display:gsg:dxgsg9(error): could not find matching vertex element data for vertex shader
:display:gsg:dxgsg9(error): could not find matching vertex element data for vertex shader
I’m certainly in favor of making it working, but we need to find someone who can do the work to make it happen. Many of our developers here use Linux or Mac, or program exclusively in Python, so there’s not a long list of people willing to fix DirectX. I believe Gogg has expressed interest in improving things, but he’s only one guy and there’s only so much he can do, so another developer willing to help would go a long way towards making it happen sooner rather than later.
Ok, understand.
I’m not very familiar with architecture of DirectX, so I will not be able to help in programming in this field. But if there will be need of testing - I can help.