3d grass

Started by TheDude, January 24, 2015, 20:12:45

Previous topic - Next topic

TheDude

How would you go about rendering grass in lwjgl. I know you can use shell rendering but how.

quew8

Ask a more specific question. Try it out, normally the process of trying will allow you to solve many of your problems for yourself.

If you have some code that doesn't work and you don't know why, ask us.
If you have no idea where to start, find a tutorial (there is always a tutorial).
If you are having trouble understanding a specific part of the tutorial ask here.
If you are having trouble porting the tutorial to Java/OpenGL/LWJGL ask here.
If you don't understand any of the tutorial, find another one and if you don't understand that one either, start with something simpler.

TheDude

There is a tutorial at this link http://www.xbdev.net/directx3dx/specialX/Fur/ which covers shell texturing i jus have no idea how to translate it into LWJGL.

quew8

First of all I've had a quick look and I think this http://www.catalinzima.com/xna/tutorials/fur-rendering/ is a better tutorial in terms of explanation and code examples and stuff.

Now what is your experience with LWJGL and OpenGL? Because I find all of the code in that tutorial readily understandable and if you are familiar with OpenGL and GLSL it should be a simple matter to look up some of the finer points of XNA's shading language (is it just HLSL) and the rest is understandable. Essentially all this is doing at the basic level is rendering a textured quad, with alpha testing, many times with a slight displacement.

So can you render a textured quad? Can you enable alpha testing? Can you program a shader which can implement a slight displacement (or even just do this in your own host program)?

I'm just not sure which bits you need help with, and if I don't know then I would have to write a whole tutorial specifically for OpenGL and LWJGL, which I'm not going to do. 

TheDude

I tired this but i just can't seem to be able to port it to java. I have a character(.obj file) with a texture if this is any help.

quew8

It doesn't.

Can you render that texture onto a quad? Because as I said before if you can, then you are half way there.

TheDude


quew8

Then what is the issue? Do you not understand the technique?

TheDude

It all makes sense to me but can't for the life of me get it ported properly to lwjgl without errors.

quew8

So post the code you have tried and tell us why it doesn't work and/or the errors that it generates.

Then we can help.

TheDude

Ok, I'll get,to that this,week.