Npr
2 Attachment(s)
Hi all, as part of a final yr project for my degree i want to produce a walk-through using non-photorealistic rendering techniques. I'm experimenting with a GLSL sketch-like shader produced using Mental Mill (i am not a programmer) using:
- toon2 = viz.addShader(vert='MySketch1_v.gl', frag = 'MySketch_f.gl') - - box2.apply(toon2) - but i get this error message: glLinkProgram "" FAILED Program "" infolog: Vertex info ----------- (20) : warning C7011: implicit cast from "vec4" to "vec3" (20) : warning C7011: implicit cast from "vec4" to "vec3" Fragment info ------------- (581) : warning C7011: implicit cast from "vec4" to "float" (581) : warning C7011: implicit cast from "float" to "vec4" (581) : error C3002: call to undefined function "saturate" I would be VERY grateful of ANY help at all with this as I feel like i've come to a grinding halt. (I have attached the vert and frag files converted to txt so that i could upload them) Regards Nige |
It seems like Mental Mill did not produce valid GLSL code. The warnings should not be a big deal. However, there is an error in the fragment shader. GLSL has no saturate function. Even without this error, you will still need to do a lot more to get the shader working. The vertex and fragment shaders depend on runtime uniforms, which you have not declared in your script. Your vertex shader requires the following uniforms:
Code:
uniform float flip_normal; Code:
// |
Npr
Thank you very much for your prompt reply, the Vizard forum is a wonderful resource for me:). I think I may have bitten off more than I can chew with this and am having to re-consider the content of my project :o, I added the uniforms to my sample script but feel I must have done it incorrectly because although there was no errors displayed there was also no noticable effect on the model!!! But as you say the shader needs more work and my knowledge in this area is lacking . . . . . .
Another (simpler, yet slightly less effective) option for me may be to use the supplied toon shader -couple of questions - is there a way of removing the modifier from an object once it has been added and is there a way of controlling the colour of an object with toon applied? Thanks for your patience :o. |
I've attached a script that shows how to dynamically add/remove the toon shader from a model and how to dynamically change its color. Let me know if anything is not clear:
Code:
import viz |
NPR _ Thanks
Thank you farshizzo, that code was great - i'm enjoying expanding my python vocabulary. I think this will be a good compromise until (if ;) !) I get my shader working. Are there any good sources of info about this subject that you no of?
Thanks again |
The OpenGL website has some links to GLSL tutorials. Here is a link to the page: http://www.opengl.org/code/category/C20
|
All times are GMT -7. The time now is 05:04 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC