Lots of different DrawPrim c++ code

Posts 1–7 of 7 · Page 1 of 1
Lots of different DrawPrim c++ code
i like to just randomly read through sections of the Lithtech jupiter engine documentation all the time, and today i found all this code that has to do with DrawPrim. I know its important to you guys, although i don't know enough to know how lol anyway, here is what i found, hopefully you find it helpful.

if DRAWPRIM_TRANSFORM_SCREEN is set for this call:
Code:
D3DVERTEXELEMENT9 decl_DrawPrimPosTColorTex[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 }, //size 16
	{ 0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	{ 0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float4 Position : POSITION0;
	float4 Color 	: COLOR0;
	float2 TexCoord : TEXCOORD0;
};
If DRAWPRIM_TRANSFORM_CAMERA or DRAWPRIM_TRANSFORM_WORLD is set for this call:
Code:
D3DVERTEXELEMENT9 decl_DrawPrimPosColorTex[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
	{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	{ 0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float3 Position : POSITION0;
	float4 Color 	: COLOR0;
	float2 TexCoord : TEXCOORD0;
};
if DRAWPRIM_TRANSFORM_SCREEN is set for this call:
Code:
D3DVERTEXELEMENT9 decl_DrawPrimPosTColor[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 }, //size 16
	{ 0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float4 Position : POSITION0;
	float4 Color 	: COLOR0;
};
If DRAWPRIM_TRANSFORM_CAMERA or DRAWPRIM_TRANSFORM_WORLD is set for this call:
Code:
D3DVERTEXELEMENT9 decl_DrawPrimPosColor[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
	{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float3 Position : POSITION0;
	float4 Color 	: COLOR0;
};
Particle Systems

A particle system is an object created as OT_PARTICLESYSTEM. This can be done in game code, or as a ClientFX.

Usage
The texture applied to the particle system is passed in to the EffectShader as "texture0".

To set the EffectShader id for a given OT_PARTICLESYSTEM, use the following function:
ILTClient::SetParticleSystemEffectShaderID(HLOCALO BJ hObj, uint32 EffectShaderID);

Vertex Format

Code:
D3DVERTEXELEMENT9 decl_Particles[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
	{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, //size 12
	{ 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	{ 0, 28, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float3 Position : POSITION0;
	float3 Normal 	: NORMAL0;
	float4 Color 	: COLOR0;
	float2 TexCoord : TEXCOORD0;
};
PolyGrid

A PolyGrid is an object created as OT_POLYGRID. These are grids of polygons generally used for water effects.

Usage
The texture applied to the PolyGrid is passed in to the EffectShader as "texture0". If an environment map is specified, it will be passed in as "texture1".
Make sure that Additive, Multiply, Fresnel and NormalMapSprite are set to false.

To set the EffectShader id for a given OT_POLYGRID, use the following function:
ILTClient::SetPolyGridEffectShaderID(HLOCALOBJ hObj, uint32 EffectShaderID);

Vertex Format
Code:
D3DVERTEXELEMENT9 decl_Polygrid[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
	{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, //size 12
	{ 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	{ 0, 28, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
	{ 0, 36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 },
	{ 0, 48, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0 },
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float3 Position : POSITION0;
	float3 Normal 	: NORMAL0;
	float4 Color 	: COLOR0;
	float2 TexCoord : TEXCOORD0;
	float3 Tangent : TANGENT0;
	float3 Binormal : BINORMAL0;
};
Sprites

Sprites are generated from the creation of an OT_SPRITE object, and consist of two polygons to form a plane.

Usage
The texture applied to the Sprite is passed in to the EffectShader as "texture0".

To set the EffectShader id for a given OT_SPRITE, use the following function:
ILTClient::SetSpriteEffectShaderID(HLOCALOBJ hObj, uint32 EffectShaderID);

Vertex Format
Code:
D3DVERTEXELEMENT9 decl_Sprite[] =
{
	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
	{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
	{ 0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
	D3DDECL_END()
};

HLSL Vertex Declaration 
struct VERTEX_IN 
{
	float3 Position : POSITION0;
	float4 Color 	: COLOR0;
	float2 TexCoord : TEXCOORD0;
};

hopefully this is useful in some way!
very nice function, should help me a bit im missin this XD
i have more too just didn't post

but what exactly is drawprim? lol
Quote Originally Posted by supercarz1991 View Post
i have more too just didn't post

but what exactly is drawprim? lol
Drawprim most used way is in the WorldToScreen Function for ESP.
Ahh so this code is either really good or useless haha
Quote Originally Posted by supercarz1991 View Post
Ahh so this code is either really good or useless haha
really good lol but i believe 2 of these are in gellin's base

i used the texttoworld in a part of my ESP just now so ty'ed
Quote Originally Posted by Wilds View Post
really good lol but i believe 2 of these are in gellin's base

i used the texttoworld in a part of my ESP just now so ty'ed
these are straight from the lithtech jupiter enterprise documentation. so he could have found it before me and used it
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us