AndiNo wrote:
If I understand correctly what you want to do you just have to scale your ManualObject in Ogre, not in the shader. Everything else related to this texture-multiple-times-on-face problem has been discussed in the "PolyVox and Ogre3D" thread.
No, I scaled my manuel object so it is "big enough" in my world. I want to scale UV cordinates so that every 16 units in world space is 1 unit in texture space -> I want to divide my inWorldPosition.xy / xz/ yz by 16. Ideally I would pass that into the shader at runtime instead of hard coding a 16 (pass a value scale into my ColouredCubicVoxelFP somehow) that way if I change scale in my program, it automatically changes in my shader. Unfortunately while I believe this is possible, I have absolutely no idea how to do it.
Quote:
Computing the normals in the shader:
The two lines mentioned by David in another thread are the very first thing in my ColouredCubicVoxelFP fragment/pixel shader. Of course you then have to delete any reference to things like "inNormal" etc because you are now using your calculated normals.
This worked perfectly, thank you! After I did it, it seemed so obvious... *sigh*
Quote:
Cg is nearly the same as HLSL. Whenever you search for something specific just Google "HLSL yoursearch". I looked here for info very often:
http://msdn.microsoft.com/en-us/library/bb509561%28VS.85%29.aspxThe problem I'm having with this is that it seems when reading stuff nothing comes in bite size chunks, it feels like every tutorial and every example is just the whole bloody thing - and starting from the beginning isn't what I want either (because that would take forever and I only want to do a few things with shaders and then pretty much leave them alone until EVERYTHING else is done (afterall what is the point of cool effects if there is no game) . Anyways I appreciate the refrence, I'm still hoping to find the hidden cg API in a format similar to Javas : ) wouldn't that be nice... I'm dreaming now.
Quote:
Scaling:
Usually when you multiply a float4 with 2 for example every component of that float4 is multiplied by 2. This should apply to all other "arrays" like float2 etc.
This is precisely what causes my error. I'm really wondering how in the heck you did it. I've read EVERY post in the top 7 most current posts on this forum at least 3-4 times, it's not a matter of I haven't tried to figure it out on my own, I promise.
David's solution of dividing by 100 (for me would be 16) straight up crashes me. It gives me that error X6077 telling me I can't modify the crap in the if statement (I'm not using any other conditionals or looping). What it really means is that for some damn reason I cannot have the 2nd parameter of inWorldPosition be any derivitive of inWorldPosition. It doesn't matter if I try and make a temporary variable, and set tmp = iWP/16 and then use tmp.XX it still has same error.
What I can do is make a static float2 and use it as the 2nd parameter in tex2D (for instance one time I made 1 face always use the bottom right pixel of my texture by makeing a float2 tmp = {1, 1}; and then saying col = tex2D(heightMap, tmp); One thing that just occured to me is to try and scale that value and see if that also crashs the program... Anyways, it is the most frusterating thing to be spending time on, because it seems like it should be so fking simple, and without changing it everything looks horrible. Also there is no way for me to start on the texture atlas side of things if I can't get 1 image showing up on 1 face at the scale of my choosing
.