![]() |
|
#1
|
|||
|
|||
Error compiling ... ?
Hi,
I tried this just now and I get this error everytime I run it. The Blending looks okay though. I'll play around with it more. I have CG toolkit 1.4.1 installed. ----------------------------------- FRAGMENT glCompileShader "" FAILED FRAGMENT Shader "" infolog: ERROR: 0:6: 'texture2D' : no matching overloaded function found ERROR: 0:6: '=' : cannot convert from 'const float' to '4-component vector of float' ERROR: 0:7: 'texture2D' : no matching overloaded function found ERROR: 0:7: 'assign' : cannot convert from 'float' to 'FragColor 4-component vector of float' ERROR: 4 compilation errors. No code generated. glLinkProgram "" FAILED Program "" infolog: Link failed. All shader objects have not been successfully compiled. ------------------------- |
#2
|
|||
|
|||
Hi,
Sorry about that. Replace the the code in the shader file with the following: Code:
uniform sampler2D BaseTexture; uniform sampler2D DetailTexture; void main (void) { vec4 detailColor = texture2D(DetailTexture, gl_TexCoord[1].xy); gl_FragColor = (texture2D(BaseTexture, gl_TexCoord[0].xy) * detailColor.r) * 2.0; } |
#3
|
|||
|
|||
![]()
Hi,
It works! Have a look at the screenshots attached. The fog is completely gone?!? and the terrain is somehow very-brightly lit!! (perhaps this is caused by uniform intensity command?)In which actually looks nice, I could turn down the spot light color a bit to get the brownish feeling on the planet. I like the result! heaps better than normal blending. Thank you! From high elevation the terrain looks bit funny with tiled detail texture (oh well). From right above the ground... the terrain looks amazing!! What do you think? Regards, Iwan |
#4
|
|||
|
|||
Hi,
I agree, the close-up shot looks really cool! But the tiling is noticeable from far away. The second example you posted would fix the tiling problem, but it might be harder to create the textures for it. The fog is gone because you are using a shader. You will have to implement the fog in the shader. Let me know if you need help with this. The terrain is bright because of the scale applied. In the shader try changing the scale parameter from 2.0 to 1.0. If you end up doing this, then you don't even need the shader anymore, plus the fog will work again. Either way, I just added the ability to set all the texture combine properties from within Vizard. This should be available in the next release. |
#5
|
|||
|
|||
![]()
Hi,
I would definitely need your expertise in this matter, since you solved the shader problem within a couple of minutes while it would probably take me 2 months alone on it. Fog shader would be great, what about fractal animated layered fogs? would this be too much asking for next release??? ...perhaps something like; fog1 = viz.add(viz.fogshader, 'someFractalImage.png') #finite fog shader fog1.size(10,1,10) #fog plane 100 unit square fog1.transform(0,2,0) #putting the fog plane 2 unit up fog1.animate(1,0,0, 4) #animating the fog 4 unit/sec in x direction fog1.intensity(1.5) fog1.amplitude(1.5) # strength of someFractalImageImage.png fog1.color(0.92, 0.92, 0.98) #blue-ish color hmmm... somehow this ideas might go futher to fractal animated cloud plane ![]() I wish you guys all the best in improving vizard. *edited* for incorrect grammar :P Regards, Iwan |
#6
|
|||
|
|||
Here is a version of the shader that implements exponential fog:
Code:
uniform sampler2D BaseTexture; uniform sampler2D DetailTexture; const float LOG2E = 1.442695; void main (void) { float fog = exp2(gl_Fog.density * gl_FogFragCoord * LOG2E); fog = clamp(fog, 0.0, 1.0); vec4 textureColor = (texture2D(BaseTexture, gl_TexCoord[0].xy) * texture2D(DetailTexture, gl_TexCoord[1].xy).r) * 2.0; gl_FragColor = vec4(mix( vec3(gl_Fog.color), vec3(textureColor), fog), textureColor.a); } Do you have any links explaining fractal animated layered fog, a quick google search didn't find anything. The following page has an example that creates a moving cloud plane. I'm not sure if this is what you are looking for, but it might be useful. http://www.worldviz.com/forum/showthread.php?t=549 |
#7
|
|||
|
|||
Hi,
I will give it a try. I didn't modify the shader to remove the brightness effects because I happen to like it. But, for the openday we used blend option as I didn't have enough time to fix the texture tiling problem. I'll give this one a try. I gave the could plane a try some months ago, it looked great but doesn't suit with my mars. I was looking for more... glommy cloud to give distress feeling. I got this idea of animated layered fog from www.garagegames.com forum, as I happen to be an owner of Torque SDK. Here's the link of fractal animated cloud, which I believe also suitable for low laying animated fog. http://www.garagegames.com/index.php...=view&qid=3525 you do not need to create account to view this link, this resource is public. Thank you for help, can't wait to see what you guys will have on the actual final release ![]() Regards, Iwan |
![]() |
|
|